HomeFreeBSD

unionfs: allow recursion on covered vnode lock during mount/unmount

Description

unionfs: allow recursion on covered vnode lock during mount/unmount

When taking the covered vnode lock during mount and unmount operations,
specify LK_CANRECURSE as the existing lock state of the covered vnode
is not guaranteed (AFAIK) either by assertion or documentation for
these code paths.

For the mount path, this is done only for completeness as the covered
vnode lock is not currently held when VFS_MOUNT() is called.
For the unmount path, the covered vnode is currently held across
VFS_UNMOUNT(), and the existing code only happens to work when unionfs
is mounted atop FFS because FFS sets LO_RECURSABLE on its vnode locks.

This of course doesn't cover a hypothetical case in which the covered
vnode may be held shared, but for the mount and unmount paths such a
scenario seems unlikely to materialize.

Reviewed by: kib
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D37458

Details

Provenance
jahAuthored on Nov 20 2022, 6:25 PM
Reviewer
kib
Differential Revision
D37458: Various fixes related to VV_CROSSLOCK handling
Parents
rG42442d7a6eeb: Generalize the VV_CROSSLOCK logic in vfs_lookup()
Branches
Unknown
Tags
Unknown