• Konstantin Belousov's avatar
    null_vput_pair(): release use reference on dvp earlier · 16dea834
    Konstantin Belousov authored
    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