Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Nov 2011 23:35:43 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227543 - head/sys/fs/nfsclient
Message-ID:  <201111152335.pAFNZhJ7021661@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Nov 15 23:35:43 2011
New Revision: 227543
URL: http://svn.freebsd.org/changeset/base/227543

Log:
  Modify the new NFS client so that nfs_fsync() only calls ncl_flush()
  for regular files. Since other file types don't write into the
  buffer cache, calling ncl_flush() is almost a no-op. However, it does
  clear the NMODIFIED flag and this shouldn't be done by nfs_fsync() for
  directories.
  
  MFC after:	2 weeks

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

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Tue Nov 15 23:32:30 2011	(r227542)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Tue Nov 15 23:35:43 2011	(r227543)
@@ -2580,6 +2580,16 @@ nfs_strategy(struct vop_strategy_args *a
 static int
 nfs_fsync(struct vop_fsync_args *ap)
 {
+
+	if (ap->a_vp->v_type != VREG) {
+		/*
+		 * For NFS, metadata is changed synchronously on the server,
+		 * so there is nothing to flush. Also, ncl_flush() clears
+		 * the NMODIFIED flag and that shouldn't be done here for
+		 * directories.
+		 */
+		return (0);
+	}
 	return (ncl_flush(ap->a_vp, ap->a_waitfor, NULL, ap->a_td, 1, 0));
 }
 



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