Fix OpenDowngrade for NFSv4.1 if a client sets the OPEN_SHARE_ACCESS_WANT* bits.
The NFSv4.1 RFC specifies that the OPEN_SHARE_ACCESS_WANT bits can be set in the OpenDowngrade share_access argument and are basically ignored. I do not know of a extant NFSv4.1 client that does this, but this little patch fixes it just in case. It also changes the error from NFSERR_BADXDR to NFSERR_INVAL since the NFSv4.1 RFC specifies this as the error to be returned if bogus bits are set. (The NFSv4.0 RFC didn't specify any error for this, so the error reply can be changed for NFSv4.0 as well.) Found by inspection while looking at a problem with OpenDowngrade reported for the ESXi 6.5 NFSv4.1 client. Reported by: andreas.nagy@frequentis.com PR: 227214 MFC after: 1 week
This commit is contained in:
parent
3a63d3a438
commit
8cd51ec4a0
@ -3237,6 +3237,8 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
tl += (NFSX_STATEIDOTHER / NFSX_UNSIGNED);
|
||||
stp->ls_seq = fxdr_unsigned(u_int32_t, *tl++);
|
||||
i = fxdr_unsigned(int, *tl++);
|
||||
if ((nd->nd_flag & ND_NFSV41) != 0)
|
||||
i &= ~NFSV4OPEN_WANTDELEGMASK;
|
||||
switch (i) {
|
||||
case NFSV4OPEN_ACCESSREAD:
|
||||
stp->ls_flags = (NFSLCK_READACCESS | NFSLCK_DOWNGRADE);
|
||||
@ -3249,7 +3251,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
NFSLCK_DOWNGRADE);
|
||||
break;
|
||||
default:
|
||||
nd->nd_repstat = NFSERR_BADXDR;
|
||||
nd->nd_repstat = NFSERR_INVAL;
|
||||
}
|
||||
i = fxdr_unsigned(int, *tl);
|
||||
switch (i) {
|
||||
@ -3265,7 +3267,7 @@ nfsrvd_opendowngrade(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
stp->ls_flags |= (NFSLCK_READDENY | NFSLCK_WRITEDENY);
|
||||
break;
|
||||
default:
|
||||
nd->nd_repstat = NFSERR_BADXDR;
|
||||
nd->nd_repstat = NFSERR_INVAL;
|
||||
}
|
||||
|
||||
clientid.lval[0] = stp->ls_stateid.other[0];
|
||||
|
Loading…
Reference in New Issue
Block a user