NFSD: fix hang in nfsd4_shutdown_callback
Subsystems (2)
Dai Ngo
reviewerPATCH v2 1/1 NFSD: fix hang in nfsd4_shutdown_callback
If nfs4_client is in courtesy state then there is no point to retry 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 nnfsd4_run_cb_work to skip the RPC call if nfs4_client is in courtesy state.
--- fs/nfsd/nfs4callback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/nfsd/nfs4callback.c +5 -2
@@ -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 ; }
Signature · 1 line
2.43.5
Quoted 21 lines · Dai Ngo
If
nfs4_clientis in courtesy state then there is no point to retry the callback. This causesnfsd4_shutdown_callbackto hang sincecl_cb_inflightis not 0. This hang lasts about 15 minutes until TCP notifies NFSD that the connection was dropped.This patch modifies
nnfsd4_run_cb_workto skip the RPC call ifnfs4_clientis in courtesy state.Signed-off-by Dai Ngo <[email protected]>--- fs/nfsd/nfs4callback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)fs/nfsd/nfs4callback.c +0
-0@@ -1583,8 +1583,11 @@ nfsd4_run_cb_work(struct work_struct *work)nfsd4_process_cb_update (cb); clnt = clp->cl_cb_client;
fs/nfsd/nfs4callback.c nfsd4_run_cb_work(struct work_struct *work) · line 1593
Quoted 10 lines
fs/nfsd/nfs4callback.c +5
-2-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 ; }
For subsequent postings, please send to all NFSD reviewers listed in the kernel's MAINTAINERS file. Thanks!
Quoted 2 lines · Dai Ngo
If
nfs4_clientis in courtesy state then there is no point to retry the callback.
Perhaps this should be amended "there is no point to send the callback." because this revision of the patch affects first transmissions as well as retries.
Quoted 7 lines
This causes
nfsd4_shutdown_callbackto hang sincecl_cb_inflightis not 0. This hang lasts about 15 minutes until TCP notifies NFSD that the connection was dropped.This patch modifies
nnfsd4_run_cb_workto skip the RPC call ifnfs4_clientis in courtesy state.
only delegation")
Cc: [email protected]
Quoted 23 lines
Signed-off-by Dai Ngo <[email protected]>--- fs/nfsd/nfs4callback.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)fs/nfsd/nfs4callback.c +5
-2@@ -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 ; }
Signature · 1 line
Chuck Lever
[email protected]
maintainerFrom: Chuck Lever <[email protected]>
Quoted 9 lines · Dai Ngo
If
nfs4_clientis in courtesy state then there is no point to retry the callback. This causesnfsd4_shutdown_callbackto hang sincecl_cb_inflightis not 0. This hang lasts about 15 minutes until TCP notifies NFSD that the connection was dropped.This patch modifies
nnfsd4_run_cb_workto skip the RPC call ifnfs4_clientis in courtesy state.[...]
Applied to nfsd-testing, thanks!
[1/1] NFSD: fix hang in nfsd4_shutdown_callback
commit: c1d827093999bd9c19d81b0af4b3034a55b49d5a
--
Chuck Lever