HomeFreeBSD

vfs: fix lock recursion in vrele

Description

vfs: fix lock recursion in vrele

vrele is supposed to be called with an unlocked vnode, but this was never
asserted for if v_usecount was > 0. For such counts the lock is never touched
by the routine. As a result the kernel has several consumers which expect
vunref semantics and get away with calling vrele since they happen to never do
it when this is the last reference (and for some of them this may happen to be
a guarantee).

Work around the problem by changing vrele semantics to tolerate being called
with a lock. This eliminates a possible bug where the lock is already held and
vputx takes it anyway.

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

Details

Provenance
mjgAuthored on
Reviewer
kib
Differential Revision
D23528: 1/3 vfs: prevent recursion on the vnode lock in vrele
Parents
rS357728: Tidy up zpcpu_replace*
Branches
Unknown
Tags
Unknown