1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

NFSD: fix hang in nfsd4_shutdown_callback

If nfs4_client is in courtesy state then there is no point to send
the callback. This causes nfsd4_shutdown_callback to hang since
cl_cb_inflight is not 0. This hang lasts about 15 minutes until TCP
notifies NFSD that the connection was dropped.

This patch modifies nfsd4_run_cb_work to skip the RPC call if
nfs4_client is in courtesy state.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Fixes: 66af257999 ("NFSD: add courteous server support for thread with only delegation")
Cc: stable@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
Dai Ngo 2025-01-30 11:01:27 -08:00 committed by Chuck Lever
parent d9d6b74e4b
commit 036ac2778f

View file

@ -1583,8 +1583,11 @@ nfsd4_run_cb_work(struct work_struct *work)
nfsd4_process_cb_update(cb);
clnt = clp->cl_cb_client;
if (!clnt) {
/* Callback channel broken, or client killed; give up: */
if (!clnt || clp->cl_state == NFSD4_COURTESY) {
/*
* Callback channel broken, client killed or
* nfs4_client in courtesy state; give up.
*/
nfsd41_destroy_cb(cb);
return;
}