Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Oct 2019 03:25:12 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r353132 - projects/nfsv42/sys/fs/nfsclient
Message-ID:  <201910060325.x963PCMi017975@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Oct  6 03:25:12 2019
New Revision: 353132
URL: https://svnweb.freebsd.org/changeset/base/353132

Log:
  Update the comments related to flushing in Seek and Copy.
  
  Add information to the comments on flushing to explain why a commit is
  done for the input file for both Seek and Copy.
  Do not require a commit for the output file for Copy, since that should
  not be required.

Modified:
  projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c

Modified: projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c	Sun Oct  6 01:35:31 2019	(r353131)
+++ projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c	Sun Oct  6 03:25:12 2019	(r353132)
@@ -3588,11 +3588,15 @@ nfs_copy_file_range(struct vop_copy_file_range_args *a
 	 * Flush the input file so that the data is up to date before
 	 * the copy.  Flush writes for the output file so that they
 	 * do not overwrite the data copied to the output file by the Copy.
+	 * Although a Commit is not required, the commit argument is set
+	 * on the invp so that, for a pNFS File/Flexible File Layout
+	 * server, the LayoutCommit will be done to ensure the input file size
+	 * is up to date on the Metadata Server.
 	 */
 	if (error == 0)
 		error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0);
 	if (error == 0)
-		error = ncl_flush(outvp, MNT_WAIT, curthread, 1, 0);
+		error = ncl_flush(outvp, MNT_WAIT, curthread, 0, 0);
 
 	/* Do the actual NFSv4.2 RPC. */
 	len = *ap->a_lenp;
@@ -3739,7 +3743,13 @@ nfs_ioctl(struct vop_ioctl_args *ap)
 	if (*((off_t *)ap->a_data) >= VTONFS(vp)->n_size)
 		error = ENXIO;
 	else {
-		/* Flush all writes, so that the server is up to date. */
+		/*
+		 * Flush all writes, so that the server is up to date.
+		 * Although a Commit is not required, the commit argument
+		 * is set so that, for a pNFS File/Flexible File Layout
+		 * server, the LayoutCommit will be done to ensure the file
+		 * size is up to date on the Metadata Server.
+		 */
 		error = ncl_flush(vp, MNT_WAIT, ap->a_td, 1, 0);
 		if (error == 0)
 			error = nfsrpc_seek(vp, (off_t *)ap->a_data, &eof,



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