aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-05-18 22:53:54 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-06-01 01:41:08 +0000
commit2f6ce1167391e8b1883bccc98f60b129fec4a9e3 (patch)
treedc571bd55f1b774363ccd8e098ad8711b55e3157
parenta604806bf73fdac21485bcb14ac6d56cb66b5210 (diff)
downloadsrc-2f6ce1167391e8b1883bccc98f60b129fec4a9e3.tar.gz
src-2f6ce1167391e8b1883bccc98f60b129fec4a9e3.zip
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. (cherry picked from commit b3d4c70dc60f1913f2363751b905b562c39ca126)
-rw-r--r--sys/fs/nfsserver/nfs_nfsdserv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c
index f667b1f88e86..4aa009b345fe 100644
--- a/sys/fs/nfsserver/nfs_nfsdserv.c
+++ b/sys/fs/nfsserver/nfs_nfsdserv.c
@@ -2913,7 +2913,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);
@@ -2988,7 +2989,7 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int isdgram,
&exclusive_flag, &nva, cverf, create, aclp, &attrbits,
nd->nd_cred, p, 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);
@@ -3006,7 +3007,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;
}