svn commit: r245262 - head/sys/fs/nullfs

Konstantin Belousov kib at FreeBSD.org
Thu Jan 10 18:24:48 UTC 2013


Author: kib
Date: Thu Jan 10 18:24:48 2013
New Revision: 245262
URL: http://svnweb.freebsd.org/changeset/base/245262

Log:
  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

Modified:
  head/sys/fs/nullfs/null_vnops.c

Modified: head/sys/fs/nullfs/null_vnops.c
==============================================================================
--- head/sys/fs/nullfs/null_vnops.c	Thu Jan 10 18:04:42 2013	(r245261)
+++ head/sys/fs/nullfs/null_vnops.c	Thu Jan 10 18:24:48 2013	(r245262)
@@ -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);
 


More information about the svn-src-all mailing list