summaryrefslogtreecommitdiff
path: root/net/sunrpc/pmap_clnt.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-22 14:32:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-22 14:32:15 -0700
commit9092131f7ea2f9e92a510ae13ac4d20165aa921c (patch)
tree4bcac80a227d320b69454057cdcef41ef43c6c85 /net/sunrpc/pmap_clnt.c
parentf1b04770b0d073a9d70e5b3b873d274c1c19e1f6 (diff)
parenteadf4598e7ec37a234e70e965bd335860e58bda4 (diff)
Merge rsync://client.linux-nfs.org/pub/linux/nfs-2.6
Diffstat (limited to 'net/sunrpc/pmap_clnt.c')
-rw-r--r--net/sunrpc/pmap_clnt.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c
index d0b1d2c34a4d..4e81f2766923 100644
--- a/net/sunrpc/pmap_clnt.c
+++ b/net/sunrpc/pmap_clnt.c
@@ -53,6 +53,9 @@ rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt)
task->tk_pid, clnt->cl_server,
map->pm_prog, map->pm_vers, map->pm_prot);
+ /* Autobind on cloned rpc clients is discouraged */
+ BUG_ON(clnt->cl_parent != clnt);
+
spin_lock(&pmap_lock);
if (map->pm_binding) {
rpc_sleep_on(&map->pm_bindwait, task, NULL, NULL);
@@ -207,12 +210,10 @@ pmap_create(char *hostname, struct sockaddr_in *srvaddr, int proto)
xprt->addr.sin_port = htons(RPC_PMAP_PORT);
/* printk("pmap: create clnt\n"); */
- clnt = rpc_create_client(xprt, hostname,
+ clnt = rpc_new_client(xprt, hostname,
&pmap_program, RPC_PMAP_VERSION,
RPC_AUTH_UNIX);
- if (IS_ERR(clnt)) {
- xprt_destroy(xprt);
- } else {
+ if (!IS_ERR(clnt)) {
clnt->cl_softrtry = 1;
clnt->cl_chatty = 1;
clnt->cl_oneshot = 1;