2012-12-17 17:18:22

by Stanislav Kinsbursky

[permalink] [raw]
Subject: [PATCH] SUNRPC: continue run over clients list on PipeFS event instead of break

There are SUNRPC clients, which program doesn't have pipe_dir_name. These
clients can be skipped on PipeFS events, because nothing have to be created or
destroyed. But instead of breaking in case of such a client was found, search
for suitable client over clients list have to be continued. Otherwise some
clients could not be covered by PipeFS event handler.

Signed-off-by: Stanislav Kinsbursky <[email protected]>
Cc: [email protected] [>= v3.4]
---
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 cdc7564..10b18b2 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -234,7 +234,7 @@ static struct rpc_clnt *rpc_get_client_for_event(struct net *net, int event)
spin_lock(&sn->rpc_client_lock);
list_for_each_entry(clnt, &sn->all_clients, cl_clients) {
if (clnt->cl_program->pipe_dir_name == NULL)
- break;
+ continue;
if (rpc_clnt_skip_event(clnt, event))
continue;
if (atomic_inc_not_zero(&clnt->cl_count) == 0)



2012-12-17 17:21:59

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH] SUNRPC: continue run over clients list on PipeFS event instead of break

On Mon, 2012-12-17 at 20:18 +-0300, Stanislav Kinsbursky wrote:
+AD4- There are SUNRPC clients, which program doesn't have pipe+AF8-dir+AF8-name. These
+AD4- clients can be skipped on PipeFS events, because nothing have to be created or
+AD4- destroyed. But instead of breaking in case of such a client was found, search
+AD4- for suitable client over clients list have to be continued. Otherwise some
+AD4- clients could not be covered by PipeFS event handler.
+AD4-
+AD4- Signed-off-by: Stanislav Kinsbursky +ADw-skinsbursky+AEA-parallels.com+AD4-
+AD4- Cc: stable+AEA-vger.kernel.org +AFsAPgA9- v3.4+AF0-
+AD4- ---
+AD4- net/sunrpc/clnt.c +AHw- 2 +--
+AD4- 1 files changed, 1 insertions(+-), 1 deletions(-)
+AD4-
+AD4- diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
+AD4- index cdc7564..10b18b2 100644
+AD4- --- a/net/sunrpc/clnt.c
+AD4- +-+-+- b/net/sunrpc/clnt.c
+AD4- +AEAAQA- -234,7 +-234,7 +AEAAQA- static struct rpc+AF8-clnt +ACo-rpc+AF8-get+AF8-client+AF8-for+AF8-event(struct net +ACo-net, int event)
+AD4- spin+AF8-lock(+ACY-sn-+AD4-rpc+AF8-client+AF8-lock)+ADs-
+AD4- list+AF8-for+AF8-each+AF8-entry(clnt, +ACY-sn-+AD4-all+AF8-clients, cl+AF8-clients) +AHs-
+AD4- if (clnt-+AD4-cl+AF8-program-+AD4-pipe+AF8-dir+AF8-name +AD0APQ- NULL)
+AD4- - break+ADs-
+AD4- +- continue+ADs-
+AD4- if (rpc+AF8-clnt+AF8-skip+AF8-event(clnt, event))
+AD4- continue+ADs-
+AD4- if (atomic+AF8-inc+AF8-not+AF8-zero(+ACY-clnt-+AD4-cl+AF8-count) +AD0APQ- 0)
+AD4-

Thanks Stanislav+ACE- Applied.
--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
http://www.netapp.com