Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2012 04:12:41 +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: r229365 - in stable/8/sys: conf fs/nfsclient
Message-ID:  <201201030412.q034Cf4m004504@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Tue Jan  3 04:12:40 2012
New Revision: 229365
URL: http://svn.freebsd.org/changeset/base/229365

Log:
  MFC: r227543
  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.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clvnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.32   (props changed)
  stable/8/sys/conf/ldscript.mips.octeon1.64   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- stable/8/sys/fs/nfsclient/nfs_clvnops.c	Tue Jan  3 03:38:50 2012	(r229364)
+++ stable/8/sys/fs/nfsclient/nfs_clvnops.c	Tue Jan  3 04:12:40 2012	(r229365)
@@ -2516,6 +2516,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?201201030412.q034Cf4m004504>