Date: Sun, 6 Oct 2019 03:33:29 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r353133 - projects/nfsv42/sys/fs/nfsclient Message-ID: <201910060333.x963XTZD023532@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rmacklem Date: Sun Oct 6 03:33:28 2019 New Revision: 353133 URL: https://svnweb.freebsd.org/changeset/base/353133 Log: Do a commit for the output file when flushing for Copy. I think the output file flush should commit the data to stable storage in case the server reboots during the copy_file_range call. This way, only the Copy RPC needs to be redone for this situation. 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 03:25:12 2019 (r353132) +++ projects/nfsv42/sys/fs/nfsclient/nfs_clvnops.c Sun Oct 6 03:33:28 2019 (r353133) @@ -3588,15 +3588,14 @@ 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. + * Set the commit argument for both flushes so that the data is on + * stable storage before the Copy RPC. This is done in case the + * server reboots during the Copy and needs to be redone. */ if (error == 0) error = ncl_flush(invp, MNT_WAIT, curthread, 1, 0); if (error == 0) - error = ncl_flush(outvp, MNT_WAIT, curthread, 0, 0); + error = ncl_flush(outvp, MNT_WAIT, curthread, 1, 0); /* Do the actual NFSv4.2 RPC. */ len = *ap->a_lenp;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910060333.x963XTZD023532>