]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
nfsd: when CB_SEQUENCE gets ESERVERFAULT don't increment seq_nr
authorJeff Layton <jlayton@kernel.org>
Sun, 9 Feb 2025 12:31:26 +0000 (07:31 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 10 Mar 2025 13:11:02 +0000 (09:11 -0400)
ESERVERFAULT means that the server sent a successful and legitimate
reply, but the session info didn't match what was expected. Don't
increment the seq_nr in that case.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c

index 54f33b81d20f26189ffba70440b83c9351b4ab2a..a9e88df17f7a3c06fa505d5f7a75dea94c0e8db8 100644 (file)
@@ -1363,7 +1363,12 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
                ret = true;
                break;
        case -ESERVERFAULT:
-               ++session->se_cb_seq_nr[cb->cb_held_slot];
+               /*
+                * Call succeeded, but the session, slot index, or slot
+                * sequence number in the response do not match the same
+                * in the server's call. The sequence information is thus
+                * untrustworthy.
+                */
                nfsd4_mark_cb_fault(cb->cb_clp);
                break;
        case 1: