Skip to content

Commit be89407

Browse files
daimngomehmetb0
authored andcommitted
NFSD: fix hang in nfsd4_shutdown_callback
BugLink: https://bugs.launchpad.net/bugs/2104873 commit 036ac27 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Noah Wager <noah.wager@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent 5a3f4ab commit be89407

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
@@ -1480,8 +1480,11 @@ nfsd4_run_cb_work(struct work_struct *work)
14801480
nfsd4_process_cb_update(cb);
14811481

14821482
clnt = clp->cl_cb_client;
1483-
if (!clnt) {
1484-
/* Callback channel broken, or client killed; give up: */
1483+
if (!clnt || clp->cl_state == NFSD4_COURTESY) {
1484+
/*
1485+
* Callback channel broken, client killed or
1486+
* nfs4_client in courtesy state; give up.
1487+
*/
14851488
nfsd41_destroy_cb(cb);
14861489
return;
14871490
}

0 commit comments

Comments
 (0)