[Devel] [PATCH 2/3] sunrpc: use rpc_killall_tasks helper when "kill_tasks" toggle is raised

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Mon Jul 10 19:41:46 MSK 2017


This helper is much better.
First, is's in upsteam (I wrote it, but forgot :( ).
Second, it kills *all* tasks (including sleeping in other than "pending"
queues).

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 net/sunrpc/clnt.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 94b0187..4a2fe46 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -2543,11 +2543,8 @@ static void rpc_kill_tasks(struct net *net)
 	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
 
 	spin_lock(&sn->rpc_client_lock);
-	list_for_each_entry(clnt, &sn->all_clients, cl_clients) {
-		spin_lock(&clnt->cl_lock);
-		xprt_wake_pending_tasks(clnt->cl_xprt, -EIO);
-		spin_unlock(&clnt->cl_lock);
-	}
+	list_for_each_entry(clnt, &sn->all_clients, cl_clients)
+		rpc_killall_tasks(clnt);
 	spin_unlock(&sn->rpc_client_lock);
 }
 



More information about the Devel mailing list