HomeFreeBSD

DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts

Description

DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts

We do not require devvp vnode locked for metadata io. It is typically
not needed indeed, since correctness of the file system using
corresponding block device ensures that there is no incorrect or racy
manipulations.

But right now DEBUG_VFS_LOCKS option excludes both character device
vnodes and completely destroyed (VBAD) vnodes from asserts. This is not
too bad since WITNESS still ensures that we do not leak locks. On the
other hand, asserts do not mean what they should, to the reader, and
reliance on them being enforced might result in wrong code.

Note that ASSERT_VOP_LOCKED() still silently accepts NULLVP, I think it
is worth fixing as well, in the next round.

In collaboration with: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D32761

Details

Provenance
kibAuthored on Oct 31 2021, 9:34 PM
Reviewer
markj
Differential Revision
D32761: DEBUG_VFS_LOCKS: stop excluding devfs and doomed vnode from asserts
Parents
rG47b248ac6516: Make locking assertions for VOP_FSYNC() and VOP_FDATASYNC() more correct
Branches
Unknown
Tags
Unknown