From: Stanislav Kinsbursky Date: Mon, 24 Jun 2013 07:52:59 +0000 (+0400) Subject: SUNRPC: PipeFS MOUNT notification optimization for dying clients X-Git-Tag: v3.11-rc1~72^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f6bb246f69443549fbbd0f2abaf863243cb35e9;p=platform%2Fupstream%2Fkernel-adaptation-pc.git SUNRPC: PipeFS MOUNT notification optimization for dying clients Not need to create pipes for dying client. So just skip them. Note: we can safely dereference the client structure, because notification caller is holding sn->pipefs_sb_lock. Signed-off-by: Stanislav Kinsbursky Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust --- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index b4f1711..f0339ae9 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -177,6 +177,8 @@ static inline int rpc_clnt_skip_event(struct rpc_clnt *clnt, unsigned long event if (((event == RPC_PIPEFS_MOUNT) && clnt->cl_dentry) || ((event == RPC_PIPEFS_UMOUNT) && !clnt->cl_dentry)) return 1; + if ((event == RPC_PIPEFS_MOUNT) && atomic_read(&clnt->cl_count) == 0) + return 1; return 0; }