Skip to content

Commit 036ac27

Browse files
daimngochucklever
authored andcommitted
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: 66af257 ("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>
1 parent d9d6b74 commit 036ac27

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,11 @@ nfsd4_run_cb_work(struct work_struct *work)
15831583
nfsd4_process_cb_update(cb);
15841584

15851585
clnt = clp->cl_cb_client;
1586-
if (!clnt) {
1587-
/* Callback channel broken, or client killed; give up: */
1586+
if (!clnt || clp->cl_state == NFSD4_COURTESY) {
1587+
/*
1588+
* Callback channel broken, client killed or
1589+
* nfs4_client in courtesy state; give up.
1590+
*/
15881591
nfsd41_destroy_cb(cb);
15891592
return;
15901593
}

0 commit comments

Comments
 (0)