From bf36c14972aab13409393690eca73727d9c7fd0c Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Sun, 9 Feb 2025 07:31:26 -0500 Subject: [PATCH] nfsd: when CB_SEQUENCE gets ESERVERFAULT don't increment seq_nr 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 Signed-off-by: Chuck Lever --- fs/nfsd/nfs4callback.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 54f33b81d20f..a9e88df17f7a 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -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: -- 2.50.1