Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2013 18:24:48 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245262 - head/sys/fs/nullfs
Message-ID:  <201301101824.r0AIOmJh087640@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301101824.r0AIOmJh087640>