]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
unionfs_mkdir(): handle dvp reclamation
authorJason A. Harmening <jah@FreeBSD.org>
Mon, 16 Jan 2023 21:50:59 +0000 (15:50 -0600)
committerJason A. Harmening <jah@FreeBSD.org>
Tue, 18 Apr 2023 01:31:40 +0000 (20:31 -0500)
commit93fe61afde72e6841251ea43551631c30556032d
treef7e853c3d1f5db29fbf491d9e75eca90ca125ee7
parentd711884e60bf55c9572e1882ed1b4645a4aa1ce6
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
sys/fs/unionfs/union_vnops.c