Author: rmacklem
Date: Sun Jun 24 13:39:41 2012
New Revision: 237534
URL: http://svn.freebsd.org/changeset/base/237534

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/9/sys/fs/nfsclient/nfs_clnode.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/isp/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- stable/9/sys/fs/nfsclient/nfs_clnode.c      Sun Jun 24 09:42:36 2012        
(r237533)
+++ stable/9/sys/fs/nfsclient/nfs_clnode.c      Sun Jun 24 13:39:41 2012        
(r237534)
@@ -257,15 +257,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.
@@ -278,6 +269,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);
 
        /*
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to