diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2006-11-16 15:03:38 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-12-06 10:46:42 -0500 |
commit | 2b577f1f14c8d83ba9400ec8accaf4a208f4f36a (patch) | |
tree | ba5187ce24b061781283dd624af8416d1be3b179 /net/sunrpc/pmap_clnt.c | |
parent | a18030445fd4dd20e2248007b5d1cf0b5d89c69d (diff) |
SUNRPC: another pmap wakeup fix
Don't wake up bind waiters if a task finds that another task is already
trying to bind.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/pmap_clnt.c')
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 8d2e10fc3df9..3946ec3eb517 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c | |||
@@ -101,14 +101,14 @@ void rpc_getport(struct rpc_task *task) | |||
101 | /* Autobind on cloned rpc clients is discouraged */ | 101 | /* Autobind on cloned rpc clients is discouraged */ |
102 | BUG_ON(clnt->cl_parent != clnt); | 102 | BUG_ON(clnt->cl_parent != clnt); |
103 | 103 | ||
104 | status = -EACCES; /* tell caller to check again */ | ||
105 | if (xprt_test_and_set_binding(xprt)) | ||
106 | goto bailout_nowake; | ||
107 | |||
104 | /* Put self on queue before sending rpcbind request, in case | 108 | /* Put self on queue before sending rpcbind request, in case |
105 | * pmap_getport_done completes before we return from rpc_run_task */ | 109 | * pmap_getport_done completes before we return from rpc_run_task */ |
106 | rpc_sleep_on(&xprt->binding, task, NULL, NULL); | 110 | rpc_sleep_on(&xprt->binding, task, NULL, NULL); |
107 | 111 | ||
108 | status = -EACCES; /* tell caller to check again */ | ||
109 | if (xprt_test_and_set_binding(xprt)) | ||
110 | goto bailout_nofree; | ||
111 | |||
112 | /* Someone else may have bound if we slept */ | 112 | /* Someone else may have bound if we slept */ |
113 | status = 0; | 113 | status = 0; |
114 | if (xprt_bound(xprt)) | 114 | if (xprt_bound(xprt)) |
@@ -143,8 +143,9 @@ bailout: | |||
143 | pmap_map_free(map); | 143 | pmap_map_free(map); |
144 | xprt_put(xprt); | 144 | xprt_put(xprt); |
145 | bailout_nofree: | 145 | bailout_nofree: |
146 | task->tk_status = status; | ||
147 | pmap_wake_portmap_waiters(xprt, status); | 146 | pmap_wake_portmap_waiters(xprt, status); |
147 | bailout_nowake: | ||
148 | task->tk_status = status; | ||
148 | } | 149 | } |
149 | 150 | ||
150 | #ifdef CONFIG_ROOT_NFS | 151 | #ifdef CONFIG_ROOT_NFS |