linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] SUNRPC: skip dead but not buried clients on PipeFS events
@ 2012-04-20 14:11 Stanislav Kinsbursky
  2012-04-25 17:30 ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Stanislav Kinsbursky @ 2012-04-20 14:11 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, linux-kernel, devel

v2: atomic_inc_return() was replaced by atomic_inc_not_zero().

These clients can't be safely dereferenced if their counter in 0.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>

---
 net/sunrpc/clnt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 6797246..d10ebc4 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -218,7 +218,8 @@ static struct rpc_clnt *rpc_get_client_for_event(struct net *net, int event)
 		if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) ||
 		    ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry))
 			continue;
-		atomic_inc(&clnt->cl_count);
+		if (atomic_inc_not_zero(&clnt->cl_count) == 0)
+			continue;
 		spin_unlock(&sn->rpc_client_lock);
 		return clnt;
 	}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-04-26  6:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-20 14:11 [PATCH v2] SUNRPC: skip dead but not buried clients on PipeFS events Stanislav Kinsbursky
2012-04-25 17:30 ` J. Bruce Fields
2012-04-25 18:54   ` Myklebust, Trond
2012-04-25 21:14   ` Stanislav Kinsbursky
2012-04-26  6:31   ` Stanislav Kinsbursky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).