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
Approved by: re (gjb)
(cherry picked from commit 02cbc029dac936b4ddbc38cef969c4b30c9a7d1f)
(cherry picked from commit c76dfb929e70c80a2d0280a1371c07738d910c11)

Details

Provenance
olceAuthored on Sep 22 2023, 8:57 PM
mjgCommitted on Sep 24 2023, 9:46 PM
Reviewer
mjg
Differential Revision
D41731: vfs_lookup_cross_mount(): Fix reference counting/locking on LK_UPGRADE error
Parents
rGba4d4882ce72: vfs: count how many times vnlru got woken up due to vnode shortage
Branches
Unknown
Tags
Unknown