mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-17 05:43:59 +00:00
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:
parent
f09c52c333
commit
6b17595133
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245262
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue