aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nullfs/null_vnops.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-01-10 18:24:48 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-01-10 18:24:48 +0000
commit6b17595133226113ebc2734b0392f97190ea11f6 (patch)
tree6274362999c25e2da370348974c6e3af8f9b9a2a /sys/fs/nullfs/null_vnops.c
parentf09c52c333fa89611ddb15742ba6fd06338ec7c2 (diff)
downloadsrc-6b17595133226113ebc2734b0392f97190ea11f6.tar.gz
src-6b17595133226113ebc2734b0392f97190ea11f6.zip
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
Notes
Notes: svn path=/head/; revision=245262
Diffstat (limited to 'sys/fs/nullfs/null_vnops.c')
-rw-r--r--sys/fs/nullfs/null_vnops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index cc35d819149f..f59865f9680f 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -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);