[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111123105148.11077.63906.stgit@localhost6.localdomain6>
Date: Wed, 23 Nov 2011 14:51:48 +0300
From: Stanislav Kinsbursky <skinsbursky@...allels.com>
To: bfields@...ldses.org, Trond.Myklebust@...app.com
Cc: linux-nfs@...r.kernel.org, xemul@...allels.com, neilb@...e.de,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
jbottomley@...allels.com, davem@...emloft.net, devel@...nvz.org
Subject: [PATCH 4/6] SUNRPC: remove RPC client pipefs dentries after unregister
Without this patch we have races:
rpc_fill_super rpc_free_client
rpc_pipefs_event(MOUNT) rpc_remove_pipedir
spin_lock(&rpc_client_lock);
rpc_setup_pipedir_sb
spin_unlock(&rpc_client_lock);
spin_lock(&rpc_client_lock);
(remove from list)
spin_unlock(&rpc_client_lock);
MEAMORY LEAKED
Signed-off-by: Stanislav Kinsbursky <skinsbursky@...allels.com>
---
net/sunrpc/clnt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 61c76ae..23776a4 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -572,7 +572,6 @@ rpc_free_client(struct rpc_clnt *clnt)
{
dprintk("RPC: destroying %s client for %s\n",
clnt->cl_protname, clnt->cl_server);
- rpc_clnt_remove_pipedir(clnt);
if (clnt->cl_parent != clnt) {
rpc_release_client(clnt->cl_parent);
goto out_free;
@@ -581,6 +580,7 @@ rpc_free_client(struct rpc_clnt *clnt)
kfree(clnt->cl_server);
out_free:
rpc_unregister_client(clnt);
+ rpc_clnt_remove_pipedir(clnt);
rpc_free_iostats(clnt->cl_metrics);
kfree(clnt->cl_principal);
clnt->cl_metrics = NULL;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists