From owner-svn-src-projects@freebsd.org Sun Oct 6 03:33:29 2019 Return-Path: Delivered-To: svn-src-projects@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87C21F93A2 for ; Sun, 6 Oct 2019 03:33:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46m8Ms2kdHz4Vb9; Sun, 6 Oct 2019 03:33:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428701F339; Sun, 6 Oct 2019 03:33:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x963XTjg023533; Sun, 6 Oct 2019 03:33:29 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x963XTZD023532; Sun, 6 Oct 2019 03:33:29 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201910060333.x963XTZD023532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 6 Oct 2019 03:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r353133 - projects/nfsv42/sys/fs/nfsclient X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/nfsv42/sys/fs/nfsclient X-SVN-Commit-Revision: 353133 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Oct 2019 03:33:29 -0000 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;