Page MenuHomeFreeBSD

vfs: add VNPASS macro and augment VNASSERT to print more about the assert
ClosedPublic

Authored by mjg on Jan 28 2020, 11:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 9, 11:11 AM
Unknown Object (File)
Fri, Sep 26, 2:12 PM
Unknown Object (File)
Mon, Sep 22, 4:41 PM
Unknown Object (File)
Tue, Sep 16, 10:15 AM
Unknown Object (File)
Sep 12 2025, 5:25 AM
Unknown Object (File)
Aug 25 2025, 2:32 PM
Unknown Object (File)
Aug 24 2025, 3:36 PM
Unknown Object (File)
Aug 12 2025, 6:08 PM
Subscribers

Details

Summary

Inspired by MPASS.

VNPASS repeats the first line for panicstr, I don't know if that's a problem apart from looking weird.

Sample output:

VNASSERT failed: vp->v_holdcnt == 1234 not true at /usr/src/sys/kern/vfs_subr.c:3148 (vputx)
0xfffff80003ba71e8: type VDIR
    usecount 7, writecount 0, refcount 1 mountedhere 0
    flags (VV_ROOT)
    lock type devfs: EXCL by thread 0xfffff800027d96e0 (pid 1, kernel, tid 100002)
panic: foo test
VNASSERT failed: vp->v_holdcnt == 1234 not true at /usr/src/sys/kern/vfs_subr.c:3148 (vputx)
0xfffff80003ba51e8: type VDIR
    usecount 7, writecount 0, refcount 1 mountedhere 0
    flags (VV_ROOT)
    lock type devfs: EXCL by thread 0xfffff800027d96e0 (pid 1, kernel, tid 100002)
panic: condition vp->v_holdcnt == 1234 not met at /usr/src/sys/kern/vfs_subr.c:3148 (vputx)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I would also change VNASSERT in the way you proposed.

This revision is now accepted and ready to land.Jan 28 2020, 4:46 PM
mjg retitled this revision from vfs: add VNPASS macro to vfs: add VNPASS macro and augment VNASSERT to print more about the assert.
mjg edited the summary of this revision. (Show Details)
  • augment VNASSERT
This revision now requires review to proceed.Jan 28 2020, 6:29 PM
mjg edited the summary of this revision. (Show Details)
mjg edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jan 28 2020, 7:11 PM