nfs_commonkrpc.c: Handle NFSERR_DELAY for Sequence correctly

Unlike RFC5661 (the original NFSv4.1 RFC), RFC8881 specifies
that a NFS4ERR_DELAY reply to the SEQUENCE operation requires
a reply using the same slot/sequence#.

This patch fixes handling of this case, so it conforms to
RFC8881.

Reported by:	J. David ([email protected])
Tested by:	J. David ([email protected])
MFC after:	1 week
This commit is contained in:
Rick Macklem committed 2026-07-27 07:16:29 -07:00
1 parent cf3eeeb75c
commit 6901cbbd5a
1 file changed
+14 -1
+14 -1
View File
@@ -1145,7 +1145,20 @@ tryagain:
if ((nmp != NULL && i == NFSV4OP_SEQUENCE && j != 0) ||
(clp != NULL && i == NFSV4OP_CBSEQUENCE && j != 0)) {
NFSCL_DEBUG(1, "failed seq=%d\n", j);
if (sep != NULL && i == NFSV4OP_SEQUENCE &&
KASSERT(slot == -1, ("newnfs_request: slot not"
" -1"));
/*
* RFC8881 (unlike RFC5661) specifies that a
* NFSERR_DELAY reply to SEQUENCE is handled
* by a retry with same slot/sequence#.
* (Although not explicit, I will assume this
* applies to CB_SEQUENCE as well.)
*/
if (j == NFSERR_DELAY) {
nd->nd_repstat =
NFSERR_RETRYUNCACHEDREP;
} else if (sep != NULL &&
i == NFSV4OP_SEQUENCE &&
j == NFSERR_SEQMISORDERED) {
mtx_lock(&sep->nfsess_mtx);
sep->nfsess_badslots |=