HomeFreeBSD

unionfs_mkdir(): handle dvp reclamation

Description

unionfs_mkdir(): handle dvp reclamation

The underlying VOP_MKDIR() implementation may temporarily drop the
parent directory vnode's lock. If the vnode is reclaimed during that
window, the unionfs vnode will effectively become unlocked because
the its v_vnlock field will be reset. To uphold the locking
requirements of VOP_MKDIR() and to avoid triggering various VFS
assertions, explicitly re-lock the unionfs vnode before returning
in this case.

Note that there are almost certainly other cases in which we'll
similarly need to handle vnode relocking by the underlying FS; this
is the only one that's caused problems in stress testing so far.
A more general solution, such as that employed for nullfs in
null_bypass(), will likely need to be implemented.

Tested by: pho
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D39272

Details

Provenance
jahAuthored on Jan 16 2023, 9:50 PM
Reviewer
kib
Differential Revision
D39272: unionfs: remove LK_UPGRADE if falling back to the standard lock
Parents
rGd711884e60bf: Remove unionfs_islocked()
Branches
Unknown
Tags
Unknown