FreeBSD Bugzilla – Attachment 245723 Details for
Bug 274574
The NFSv4.1/4.2 server misparses the Open Claim_Deleg_Cur_FH option
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix handling of the Open Claim_Deleg_Cur_FH option
delegcurfh-srv.patch (text/plain), 3.08 KB, created by
Rick Macklem
on 2023-10-19 02:28:38 UTC
(
hide
)
Description:
Fix handling of the Open Claim_Deleg_Cur_FH option
Filename:
MIME Type:
Creator:
Rick Macklem
Created:
2023-10-19 02:28:38 UTC
Size:
3.08 KB
patch
obsolete
>--- sys/fs/nfsserver/nfs_nfsdserv.c.delegcurfh 2023-09-29 16:20:47.999525000 -0700 >+++ sys/fs/nfsserver/nfs_nfsdserv.c 2023-10-18 18:12:56.324764000 -0700 >@@ -3002,11 +3002,17 @@ nfsrvd_open(struct nfsrv_descript *nd, __unused int is > */ > NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); > claim = fxdr_unsigned(int, *tl); >- if (claim == NFSV4OPEN_CLAIMDELEGATECUR || claim == >- NFSV4OPEN_CLAIMDELEGATECURFH) { >+ if (claim == NFSV4OPEN_CLAIMDELEGATECUR) { > 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); >+ stp->ls_flags |= NFSLCK_DELEGCUR; >+ } else if (claim == NFSV4OPEN_CLAIMDELEGATECURFH) { >+ /* Fill in most of the stateid from the clientid. */ >+ stateid.seqid = 0; >+ stateid.other[0] = clientid.lval[0]; >+ stateid.other[1] = clientid.lval[1]; >+ stateid.other[2] = 0; > stp->ls_flags |= NFSLCK_DELEGCUR; > } else if (claim == NFSV4OPEN_CLAIMDELEGATEPREV || claim == > NFSV4OPEN_CLAIMDELEGATEPREVFH) { >--- sys/fs/nfsserver/nfs_nfsdstate.c.delegcurfh 2023-10-18 18:13:32.183631000 -0700 >+++ sys/fs/nfsserver/nfs_nfsdstate.c 2023-10-18 18:41:44.690088000 -0700 >@@ -2570,6 +2570,10 @@ tryagain: > /* > * For Delegate_Cur, search for the matching Delegation, > * which indicates no conflict. >+ * For NFSv4.1/4.2 Claim_Deleg_Cur_FH only provides >+ * the clientid, which is the first two "other" elements >+ * for the stateid. This should be sufficient, since there >+ * is only one delegation per client and file. > * An old delegation should have been recovered by the > * client doing a Claim_DELEGATE_Prev, so I won't let > * it match and return NFSERR_EXPIRED. Should I let it >@@ -2580,8 +2584,8 @@ tryagain: > (((nd->nd_flag & ND_NFSV41) != 0 && > stateidp->seqid == 0) || > stateidp->seqid == stp->ls_stateid.seqid) && >- !NFSBCMP(stateidp->other, stp->ls_stateid.other, >- NFSX_STATEIDOTHER)) >+ stateidp->other[0] == stp->ls_stateid.other[0] && >+ stateidp->other[1] == stp->ls_stateid.other[1]) > break; > } > if (stp == LIST_END(&lfp->lf_deleg) || >@@ -2832,6 +2836,10 @@ tryagain: > /* > * For Delegate_Cur, search for the matching Delegation, > * which indicates no conflict. >+ * For NFSv4.1/4.2 Claim_Deleg_Cur_FH only provides >+ * the clientid, which is the first two "other" elements >+ * for the stateid. This should be sufficient, since there >+ * is only one delegation per client and file. > * An old delegation should have been recovered by the > * client doing a Claim_DELEGATE_Prev, so I won't let > * it match and return NFSERR_EXPIRED. Should I let it >@@ -2842,8 +2850,8 @@ tryagain: > (((nd->nd_flag & ND_NFSV41) != 0 && > stateidp->seqid == 0) || > stateidp->seqid == stp->ls_stateid.seqid) && >- !NFSBCMP(stateidp->other, stp->ls_stateid.other, >- NFSX_STATEIDOTHER)) >+ stateidp->other[0] == stp->ls_stateid.other[0] && >+ stateidp->other[1] == stp->ls_stateid.other[1]) > break; > } > if (stp == LIST_END(&lfp->lf_deleg) ||
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 274574
: 245723