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

Submitted by Stanislav Kinsburskiy on July 10, 2017, 4:41 p.m.

Details

Message ID 20170710164146.15570.62435.stgit@localhost.localdomain
State New
Series "SUNRPC: fix races in tasks killing"
Headers show

Commit Message

Stanislav Kinsburskiy July 10, 2017, 4:41 p.m.
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@virtuozzo.com>
---
 net/sunrpc/clnt.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

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);
 }