freebsd-dev/sys/fs/nullfs
Konstantin Belousov 16dea83410 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
2021-03-12 13:31:08 +02:00
..
null_subr.c vfs: add v_irflag accessors 2021-01-03 06:50:06 +00:00
null_vfsops.c Make it possible to mount nullfs(5) using plain mount(8) 2020-10-29 15:28:15 +00:00
null_vnops.c null_vput_pair(): release use reference on dvp earlier 2021-03-12 13:31:08 +02:00
null.h Save lower root vnode in nullfs mnt data instead of upper. 2020-01-28 11:29:06 +00:00