Skip to contentSkip to conversation

SUNRPC: Signalled ASYNC tasks need to exit

RFC PATCH New Chuck Lever 1 participant 1 message May 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 SUNRPC: Signalled ASYNC tasks need to exit

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.

---
 net/sunrpc/clnt.c |    5 +++++
 1 file changed, 5 insertions(+)
net/sunrpc/clnt.c +5 -0
index 22d7e0a8694b..1b628b6aa172 100644
@@ -2430,6 +2430,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;