OSDN Git Service

SUNRPC: Signalled ASYNC tasks need to exit
authorChuck Lever <chuck.lever@oracle.com>
Sat, 9 May 2020 18:07:13 +0000 (14:07 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 11 May 2020 18:06:50 +0000 (14:06 -0400)
Ensure that signalled ASYNC rpc_tasks exit immediately instead of
spinning until a timeout (or forever).

To avoid checking for the signal flag on every scheduler iteration,
the check is instead introduced in the client's finite state
machine.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Fixes: ae67bd3821bb ("SUNRPC: Fix up task signalling")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/clnt.c

index 8d3972e..c74bc40 100644 (file)
@@ -2433,6 +2433,11 @@ rpc_check_timeout(struct rpc_task *task)
 {
        struct rpc_clnt *clnt = task->tk_client;
 
+       if (RPC_SIGNALLED(task)) {
+               rpc_call_rpcerror(task, -ERESTARTSYS);
+               return;
+       }
+
        if (xprt_adjust_timeout(task->tk_rqstp) == 0)
                return;