From owner-svn-src-projects@freebsd.org Sun May 27 12:06:04 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60009F706B6 for ; Sun, 27 May 2018 12:06:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8D77DB92; Sun, 27 May 2018 12:06:04 +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 C2F161E44C; Sun, 27 May 2018 12:06:03 +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 w4RC63N2068148; Sun, 27 May 2018 12:06:03 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4RC63MG068147; Sun, 27 May 2018 12:06:03 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201805271206.w4RC63MG068147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 27 May 2018 12:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r334255 - projects/pnfs-planb-server/sys/fs/nfsserver X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/pnfs-planb-server/sys/fs/nfsserver X-SVN-Commit-Revision: 334255 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.26 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, 27 May 2018 12:06:04 -0000 Author: rmacklem Date: Sun May 27 12:06:03 2018 New Revision: 334255 URL: https://svnweb.freebsd.org/changeset/base/334255 Log: Update the comment for nfsrv_copymr() to more accurately describe the algorithm. This function is currently used for recovery of a file onto a recovered DS, but will soon be modified slightly so that it can also be used to migrate a file to a different DS. Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Modified: projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 27 10:48:21 2018 (r334254) +++ projects/pnfs-planb-server/sys/fs/nfsserver/nfs_nfsdstate.c Sun May 27 12:06:03 2018 (r334255) @@ -7794,18 +7794,31 @@ nfsrv_dontlayout(fhandle_t *fhp) #define PNFSDS_COPYSIZ 65536 /* - * Do the recovery of a file for a recovered mirror. + * Create a new file on a DS and copy the contents of an extant DS file to it. + * This can be used for recovery of a DS file onto a recovered DS. * The steps are: - * - Disable issuing of rw layouts for the file. - * - Recall and wait for return of all rw layouts for the file. + * - When called, the MDS file's vnode is locked, blocking LayoutGet operations. + * - Disable issuing of read/write layouts for the file via the nfsdontlist, + * so that they will be disabled after the MDS file's vnode is unlocked. + * - Set up the nfsrv_recalllist so that recall of read/write layouts can + * be done. + * - Unlock the MDS file's vnode, so that the client(s) can perform proxied + * writes, LayoutCommits and LayoutReturns for the file when completing the + * LayoutReturn requested by the LayoutRecall callback. + * - Issue a LayoutRecall callback for all read/write layouts and wait for + * them to be returned. (If the LayoutRecall callback replies + * NFSERR_NOMATCHLAYOUT, they are gone and no LayoutReturn is needed.) + * - Exclusively lock the MDS file's vnode. This ensures that no proxied + * writes are in progress or can occur during the DS file copy. + * It also blocks Setattr operations. * - Create the file on the recovered mirror. - * - Upgrade the vnode lock on the MDS file, so that proxied writes and - * VOP_SETACL()s are blocked until the copy is complete. * - Copy the file from the operational DS. * - Copy any ACL from the MDS file to the new DS file. * - Set the modify time of the new DS file to that of the MDS file. * - Update the extended attribute for the MDS file. - * - Enable issuing of rw layouts. + * - Enable issuing of rw layouts by deleting the nfsdontlist entry. + * - The caller will unlock the MDS file's vnode allowing operations + * to continue normally, since it is now on the mirror again. */ int nfsrv_copymr(vnode_t vp, vnode_t fvp, vnode_t dvp, struct nfsdevice *ds,