diff mbox series

[v1,01/15] SUNRPC: Signalled ASYNC tasks need to exit

Message ID 20200512211256.3288.57171.stgit@manet.1015granger.net (mailing list archive)
State New, archived
Headers show
Series Possible patches for v5.8 | expand

Commit Message

Chuck Lever III May 12, 2020, 9:12 p.m. UTC
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 into the client's finite state
machine.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/clnt.c |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 8350d3a2e9a7..456e64ca14bc 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2433,6 +2433,11 @@  void rpc_force_rebind(struct rpc_clnt *clnt)
 {
 	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;