git: b3d4c70dc60f - main - nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open

Rick Macklem rmacklem at FreeBSD.org
Tue May 18 22:57:00 UTC 2021


The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=b3d4c70dc60f1913f2363751b905b562c39ca126

commit b3d4c70dc60f1913f2363751b905b562c39ca126
Author:     Rick Macklem <rmacklem at FreeBSD.org>
AuthorDate: 2021-05-18 22:53:54 +0000
Commit:     Rick Macklem <rmacklem at FreeBSD.org>
CommitDate: 2021-05-18 22:53:54 +0000

    nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open
    
    The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH
    variant of the Open operation when delegations are recalled and
    the client has a local open of the file.  This patch adds
    support for this variant of Open to the NFSv4.1/4.2 server.
    
    This patch only affects mounts from Linux clients when delegations
    are enabled on the server.
    
    MFC after:      2 weeks
---
 sys/fs/nfsserver/nfs_nfsdserv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index 8aa39e5018d9..5d6cac23b722 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -2981,7 +2981,8 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
 	 */
 	NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
 	claim = fxdr_unsigned(int, *tl);
-	if (claim == NFSV4OPEN_CLAIMDELEGATECUR) {
+	if (claim == NFSV4OPEN_CLAIMDELEGATECUR || claim ==
+	    NFSV4OPEN_CLAIMDELEGATECURFH) {
 		NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID);
 		stateid.seqid = fxdr_unsigned(u_int32_t, *tl++);
 		NFSBCOPY((caddr_t)tl,(caddr_t)stateid.other,NFSX_STATEIDOTHER);
@@ -3056,7 +3057,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
 		    &exclusive_flag, &nva, cverf, create, aclp, &attrbits,
 		    nd->nd_cred, exp, &vp);
 	} else if (claim == NFSV4OPEN_CLAIMPREVIOUS || claim ==
-	    NFSV4OPEN_CLAIMFH) {
+	    NFSV4OPEN_CLAIMFH || claim == NFSV4OPEN_CLAIMDELEGATECURFH) {
 		if (claim == NFSV4OPEN_CLAIMPREVIOUS) {
 			NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
 			i = fxdr_unsigned(int, *tl);
@@ -3074,7 +3075,6 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
 			}
 			stp->ls_flags |= NFSLCK_RECLAIM;
 		} else {
-			/* CLAIM_NULL_FH */
 			if (nd->nd_repstat == 0 && create == NFSV4OPEN_CREATE)
 				nd->nd_repstat = NFSERR_INVAL;
 		}


More information about the dev-commits-src-main mailing list