Author: rmacklem
Date: Fri May 22 15:01:47 2009
New Revision: 192582
URL: http://svn.freebsd.org/changeset/base/192582

Log:
  Change the code in the experimental nfs client to avoid flushing
  writes upon close when a write delegation is held by the client.
  This should be safe to do, now that nfsv4 Close operations are
  delayed until ncl_inactive() is called for the vnode.
  
  Approved by:  kib (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c Fri May 22 14:53:26 2009        
(r192581)
+++ head/sys/fs/nfsclient/nfs_clvnops.c Fri May 22 15:01:47 2009        
(r192582)
@@ -687,12 +687,8 @@ nfs_close(struct vop_close_args *ap)
                    int cm = newnfs_commit_on_close ? 1 : 0;
                    error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm);
                    /* np->n_flag &= ~NMODIFIED; */
-               } else if (NFS_ISV4(vp)) {
-                       int cm;
-                       if (newnfs_commit_on_close != 0)
-                               cm = 1;
-                       else
-                               cm = nfscl_mustflush(vp);
+               } else if (NFS_ISV4(vp) && nfscl_mustflush(vp)) {
+                       int cm = newnfs_commit_on_close ? 1 : 0;
                        error = ncl_flush(vp, MNT_WAIT, cred, ap->a_td, cm);
                        /* as above w.r.t. races when clearing NMODIFIED */
                        /* np->n_flag &= ~NMODIFIED; */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to