]> Pileus Git - ~andy/linux/commitdiff
SUNRPC: PipeFS MOUNT notification optimization for dying clients
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Mon, 24 Jun 2013 07:52:59 +0000 (11:52 +0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Jun 2013 19:42:26 +0000 (15:42 -0400)
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 <skinsbursky@parallels.com>
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/clnt.c

index b4f17117b779dd3242afe10be92ab49f2aa5932f..f0339ae9bf37efe9bf30acecd3639ae092c27fd0 100644 (file)
@@ -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;
 }