HomeFreeBSD

null_vput_pair(): release use reference on dvp earlier

Description

null_vput_pair(): release use reference on dvp earlier

We might own the last use reference, and then vrele() at the end would
need to take the dvp vnode lock to inactivate, which causes deadlock
with vp. We cannot vrele() dvp from start since this might unlock ldvp.

Handle it by holding the vnode and dropping use ref after lowerfs
VOP_VPUT_PAIR() ended. This effectivaly requires unlock of the vp vnode
after VOP_VPUT_PAIR(), so the call is changed to set unlock_vp to true
unconditionally. This opens more opportunities for vp to be reclaimed,
if lvp is still alive we reinstantiate vp with null_nodeget().

Reported and tested by: pho
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D29178

Details

Provenance
kibAuthored on Mar 7 2021, 9:08 PM
Reviewer
mckusick
Differential Revision
D29178: UFS SU: handle races on remounts rw<->ro
Parents
rG44691b33cc99: vlrureclaim: only skip vnode with resident pages if it own the pages
Branches
Unknown
Tags
Unknown