Skip to content

Commit f049911

Browse files
jtlaytonchucklever
authored andcommitted
nfsd: only check RPC_SIGNALLED() when restarting rpc_task
nfsd4_cb_sequence_done() currently checks RPC_SIGNALLED() when processing the compound and releasing the slot. If RPC_SIGNALLED() returns true, then that means that the client is going to be torn down. Don't check RPC_SIGNALLED() after processing a successful reply. Check it only before restarting the rpc_task. If it returns true, then requeue the callback instead of restarting the task. Also, handle rpc_restart_call() and rpc_restart_call_prepare() failures correctly, by requeueing the callback. Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 43fa890 commit f049911

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,8 +1379,8 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
13791379
goto requeue;
13801380
case -NFS4ERR_DELAY:
13811381
cb->cb_seq_status = 1;
1382-
if (!rpc_restart_call(task))
1383-
goto out;
1382+
if (RPC_SIGNALLED(task) || !rpc_restart_call(task))
1383+
goto requeue;
13841384
rpc_delay(task, 2 * HZ);
13851385
return false;
13861386
case -NFS4ERR_BADSLOT:
@@ -1396,14 +1396,16 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback
13961396
}
13971397
trace_nfsd_cb_free_slot(task, cb);
13981398
nfsd41_cb_release_slot(cb);
1399-
1400-
if (RPC_SIGNALLED(task))
1401-
goto requeue;
1402-
out:
14031399
return ret;
14041400
retry_nowait:
1405-
rpc_restart_call_prepare(task);
1406-
goto out;
1401+
/*
1402+
* RPC_SIGNALLED() means that the rpc_client is being torn down and
1403+
* (possibly) recreated. Requeue the call in that case.
1404+
*/
1405+
if (!RPC_SIGNALLED(task)) {
1406+
if (rpc_restart_call_prepare(task))
1407+
return false;
1408+
}
14071409
requeue:
14081410
nfsd41_cb_release_slot(cb);
14091411
nfsd4_requeue_cb(task, cb);

0 commit comments

Comments
 (0)