HomeFreeBSD

autofs: enable witness for autofs node lock

Description

autofs: enable witness for autofs node lock

Previously, an_vnode_lock was initialized with SX_NOWITNESS to silence
lock order reversals. The reversals would occur when autofs_node_vn()
was called with the directory vnode lock held, then lock an_vnode_lock,
then lock the vnode attached to the autofs node. It looked like:

directory vnode -> an_vnode_lock -> vnode attached to autofs node

The established lock order is now vnode -> an_vnode_lock

Currently, we don't have to worry about losing an autofs node during the
unlock/lock as autofs nodes are only removed during an unmount() after
vflush(). When autofs_node_vn() is called, the mountpoint has either
been busied (preventing unmount) or a directory vnode is locked which
prevents vflush() from finishing until the directory vnode is unlocked.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D57857

Details

Provenance
rewAuthored on Jul 3 2026, 6:55 PM
Reviewer
kib
Differential Revision
D57857: autofs: enable witness for autofs node lock
Parents
rGe89a398c108f: Add myself as ports committer, update mentor/mentee
Branches
Unknown
Tags
Unknown