lkml.org 
[lkml]   [2002]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] eliminate hangs during RPC client shutdown
linus-

this is against 2.5.31 with the recent RPC call_start/reserve patches
applied, and eliminates an infinite loop in rpciod if an RPC client's
reference counter accidentally goes negative. i've been running this
under load since 2.5.30 with no ill effects.


diff -drN -U2 06-connect2/net/sunrpc/clnt.c 07-shutdown/net/sunrpc/clnt.c
--- 06-connect2/net/sunrpc/clnt.c Mon Aug 12 16:31:53 2002
+++ 07-shutdown/net/sunrpc/clnt.c Mon Aug 12 16:53:24 2002
@@ -138,11 +138,9 @@
rpc_shutdown_client(struct rpc_clnt *clnt)
{
- dprintk("RPC: shutting down %s client for %s\n",
- clnt->cl_protname, clnt->cl_server);
- while (atomic_read(&clnt->cl_users)) {
-#ifdef RPC_DEBUG
- dprintk("RPC: rpc_shutdown_client: client %s, tasks=%d\n",
- clnt->cl_protname, atomic_read(&clnt->cl_users));
-#endif
+ dprintk("RPC: shutting down %s client for %s, tasks=%d\n",
+ clnt->cl_protname, clnt->cl_server,
+ atomic_read(&clnt->cl_users));
+
+ while (atomic_read(&clnt->cl_users) > 0) {
/* Don't let rpc_release_client destroy us */
clnt->cl_oneshot = 0;
@@ -151,4 +149,14 @@
sleep_on_timeout(&destroy_wait, 1*HZ);
}
+
+ if (atomic_read(&clnt->cl_users) < 0) {
+ printk(KERN_ERR "RPC: rpc_shutdown_client clnt %p tasks=%d\n",
+ clnt, atomic_read(&clnt->cl_users));
+#ifdef RPC_DEBUG
+ rpc_show_tasks();
+#endif
+ BUG();
+ }
+
return rpc_destroy_client(clnt);
}
--

corporate: <cel at netapp dot com>
personal: <chucklever at bigfoot dot com>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.020 / U:5.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site