When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed,

get back the leased write reference from the lower vnode.  There is no
other path which can correct v_writecount on the lowervp.

Reported by:	flo
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
This commit is contained in:
Konstantin Belousov 2013-01-10 18:24:48 +00:00
parent f09c52c333
commit 6b17595133
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245262

View file

@ -740,6 +740,14 @@ null_reclaim(struct vop_reclaim_args *ap)
vp->v_object = NULL;
vp->v_vnlock = &vp->v_lock;
VI_UNLOCK(vp);
/*
* If we were opened for write, we leased one write reference
* to the lower vnode. If this is a reclamation due to the
* forced unmount, undo the reference now.
*/
if (vp->v_writecount > 0)
VOP_ADD_WRITECOUNT(lowervp, -1);
vput(lowervp);
free(xp, M_NULLFSNODE);