HomeFreeBSD

vfs: fix reference counting/locking on LK_UPGRADE error

Description

vfs: fix reference counting/locking on LK_UPGRADE error

Factoring out this code unfortunately introduced reference and lock leaks in
case of failure in the lock upgrade path under VV_CROSSLOCK. In terms of
practical use, this impacts unionfs (and nullfs in a corner case).

Fixes: 80bd5ef07025 ("vfs: factor out mount point traversal to a dedicated routine")
MFC after: 3 days
MFC to: stable/14 releng/14.0
Sponsored by: The FreeBSD Foundation
Reviewed by: mjg
[mjg: massaged the commit message a little bit]

Differential Revision: https://reviews.freebsd.org/D41731

(cherry picked from commit 02cbc029dac936b4ddbc38cef969c4b30c9a7d1f)

Details

Provenance
olceAuthored on Sep 22 2023, 8:57 PM
mjgCommitted on Sep 24 2023, 10:44 AM
Reviewer
mjg
Differential Revision
D41731: vfs_lookup_cross_mount(): Fix reference counting/locking on LK_UPGRADE error
Parents
rGbb438c08b86a: zfs: update share/zfs/compatibility.d to match current ZFS code
Branches
Unknown
Tags
Unknown