| From f8ea072172808ca1e9184220cf8b77fc4bbc9c1c Mon Sep 17 00:00:00 2001 |
| From: Chuck Lever <chuck.lever@oracle.com> |
| Date: Sat, 9 May 2020 14:07:13 -0400 |
| Subject: [PATCH] SUNRPC: Signalled ASYNC tasks need to exit |
| |
| commit ce99aa62e1eb793e259d023c7f6ccb7c4879917b upstream. |
| |
| 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> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c |
| index d504d3a895d1..62bd29c849c1 100644 |
| --- a/net/sunrpc/clnt.c |
| +++ b/net/sunrpc/clnt.c |
| @@ -2341,6 +2341,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; |
| |
| -- |
| 2.7.4 |
| |