From de17f45628edb3cf959b61afd2319c9432005e5f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 4 Feb 2025 12:35:43 +0100 Subject: [PATCH] 5.4-stable patches added patches: nfsd-reset-cb_seq_status-after-nfs4err_delay.patch --- ...et-cb_seq_status-after-nfs4err_delay.patch | 41 +++++++++++++++++++ queue-5.4/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 queue-5.4/nfsd-reset-cb_seq_status-after-nfs4err_delay.patch diff --git a/queue-5.4/nfsd-reset-cb_seq_status-after-nfs4err_delay.patch b/queue-5.4/nfsd-reset-cb_seq_status-after-nfs4err_delay.patch new file mode 100644 index 0000000000..f2ee2aa68e --- /dev/null +++ b/queue-5.4/nfsd-reset-cb_seq_status-after-nfs4err_delay.patch @@ -0,0 +1,41 @@ +From 961b4b5e86bf56a2e4b567f81682defa5cba957e Mon Sep 17 00:00:00 2001 +From: Chuck Lever +Date: Fri, 26 Jan 2024 12:45:17 -0500 +Subject: NFSD: Reset cb_seq_status after NFS4ERR_DELAY + +From: Chuck Lever + +commit 961b4b5e86bf56a2e4b567f81682defa5cba957e upstream. + +I noticed that once an NFSv4.1 callback operation gets a +NFS4ERR_DELAY status on CB_SEQUENCE and then the connection is lost, +the callback client loops, resending it indefinitely. + +The switch arm in nfsd4_cb_sequence_done() that handles +NFS4ERR_DELAY uses rpc_restart_call() to rearm the RPC state machine +for the retransmit, but that path does not call the rpc_prepare_call +callback again. Thus cb_seq_status is set to -10008 by the first +NFS4ERR_DELAY result, but is never set back to 1 for the retransmits. + +nfsd4_cb_sequence_done() thinks it's getting nothing but a +long series of CB_SEQUENCE NFS4ERR_DELAY replies. + +Fixes: 7ba6cad6c88f ("nfsd: New helper nfsd4_cb_sequence_done() for processing more cb errors") +Reviewed-by: Jeff Layton +Reviewed-by: Benjamin Coddington +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/nfs4callback.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/nfsd/nfs4callback.c ++++ b/fs/nfsd/nfs4callback.c +@@ -1060,6 +1060,7 @@ static bool nfsd4_cb_sequence_done(struc + ret = false; + break; + case -NFS4ERR_DELAY: ++ cb->cb_seq_status = 1; + if (!rpc_restart_call(task)) + goto out; + diff --git a/queue-5.4/series b/queue-5.4/series index d3446a07aa..1fe630bb95 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -69,3 +69,4 @@ genksyms-fix-memory-leak-when-the-same-symbol-is-add.patch genksyms-fix-memory-leak-when-the-same-symbol-is-rea.patch hexagon-fix-using-plain-integer-as-null-pointer-warn.patch hexagon-fix-unbalanced-spinlock-in-die.patch +nfsd-reset-cb_seq_status-after-nfs4err_delay.patch -- 2.47.3