summaryrefslogtreecommitdiff
path: root/net/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2006-11-16 23:03:38 +0300
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 18:46:42 +0300
commit2b577f1f14c8d83ba9400ec8accaf4a208f4f36a (patch)
treeba5187ce24b061781283dd624af8416d1be3b179 /net/sunrpc
parenta18030445fd4dd20e2248007b5d1cf0b5d89c69d (diff)
downloadlinux-2b577f1f14c8d83ba9400ec8accaf4a208f4f36a.tar.xz
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')
-rw-r--r--net/sunrpc/pmap_clnt.c11
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)
/* Autobind on cloned rpc clients is discouraged */
BUG_ON(clnt->cl_parent != clnt);
+ status = -EACCES; /* tell caller to check again */
+ if (xprt_test_and_set_binding(xprt))
+ goto bailout_nowake;
+
/* Put self on queue before sending rpcbind request, in case
* pmap_getport_done completes before we return from rpc_run_task */
rpc_sleep_on(&xprt->binding, task, NULL, NULL);
- status = -EACCES; /* tell caller to check again */
- if (xprt_test_and_set_binding(xprt))
- goto bailout_nofree;
-
/* Someone else may have bound if we slept */
status = 0;
if (xprt_bound(xprt))
@@ -143,8 +143,9 @@ bailout:
pmap_map_free(map);
xprt_put(xprt);
bailout_nofree:
- task->tk_status = status;
pmap_wake_portmap_waiters(xprt, status);
+bailout_nowake:
+ task->tk_status = status;
}
#ifdef CONFIG_ROOT_NFS