Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 13:17:19 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r240197 - stable/8/sys/fs/nfsclient
Message-ID:  <201209071317.q87DHJ93005468@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Sep  7 13:17:18 2012
New Revision: 240197
URL: http://svn.freebsd.org/changeset/base/240197

Log:
  MFC: r237200
  Move the nfsrpc_close() call in ncl_reclaim() for the NFSv4 client
  to below the vnode_destroy_vobject() call, since that is where
  writes are flushed.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clnode.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/compat/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/dev/sound/   (props changed)
  stable/8/sys/dev/sound/pci/   (props changed)
  stable/8/sys/dev/virtio/   (props changed)
  stable/8/sys/kern/   (props changed)
  stable/8/sys/sys/   (props changed)
  stable/8/sys/vm/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clnode.c	Fri Sep  7 11:11:56 2012	(r240196)
+++ stable/8/sys/fs/nfsclient/nfs_clnode.c	Fri Sep  7 13:17:18 2012	(r240197)
@@ -254,15 +254,6 @@ ncl_reclaim(struct vop_reclaim_args *ap)
 	struct nfsnode *np = VTONFS(vp);
 	struct nfsdmap *dp, *dp2;
 
-	if (NFS_ISV4(vp) && vp->v_type == VREG)
-		/*
-		 * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4
-		 * Close operations are delayed until ncl_inactive().
-		 * However, since VOP_INACTIVE() is not guaranteed to be
-		 * called, we need to do it again here.
-		 */
-		(void) nfsrpc_close(vp, 1, ap->a_td);
-
 	/*
 	 * If the NLM is running, give it a chance to abort pending
 	 * locks.
@@ -275,6 +266,15 @@ ncl_reclaim(struct vop_reclaim_args *ap)
 	 */
 	vnode_destroy_vobject(vp);
 
+	if (NFS_ISV4(vp) && vp->v_type == VREG)
+		/*
+		 * We can now safely close any remaining NFSv4 Opens for
+		 * this file. Most opens will have already been closed by
+		 * ncl_inactive(), but there are cases where it is not
+		 * called, so we need to do it again here.
+		 */
+		(void) nfsrpc_close(vp, 1, ap->a_td);
+
 	vfs_hash_remove(vp);
 
 	/*



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