NFSD: Reset cb_seq_status after NFS4ERR_DELAY
authorChuck Lever <chuck.lever@oracle.com>
Fri, 26 Jan 2024 17:45:17 +0000 (12:45 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:12 +0000 (09:12 -0500)
commit961b4b5e86bf56a2e4b567f81682defa5cba957e
treef358bb827a910bfb5c91e1ae147c5cd764a5dc92
parent16fb9808ab2c99979f081987752abcbc5b092eac
NFSD: Reset cb_seq_status after NFS4ERR_DELAY

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 <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c