aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-02 13:28:04 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-02 13:32:48 -0400
commit280ebcf97ce4b252c72af74ff3149ab5a5c9e680 (patch)
treec6b713935561437044e42dc56d1a3ed4242d6b76 /net/sunrpc
parenteb6dc19d8e72ce3a957af5511d20c0db0a8bd007 (diff)
SUNRPC: rpcauth_create needs to know about rpc_clnt clone status
Ensure that we set rpc_clnt->cl_parent before calling rpc_client_register so that rpcauth_create can find any existing RPCSEC_GSS caches for this transport. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r--net/sunrpc/clnt.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index af3f0cf7e278..8572d3270783 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -313,7 +313,9 @@ out:
313 return err; 313 return err;
314} 314}
315 315
316static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) 316static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
317 struct rpc_xprt *xprt,
318 struct rpc_clnt *parent)
317{ 319{
318 const struct rpc_program *program = args->program; 320 const struct rpc_program *program = args->program;
319 const struct rpc_version *version; 321 const struct rpc_version *version;
@@ -339,7 +341,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru
339 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL); 341 clnt = kzalloc(sizeof(*clnt), GFP_KERNEL);
340 if (!clnt) 342 if (!clnt)
341 goto out_err; 343 goto out_err;
342 clnt->cl_parent = clnt; 344 clnt->cl_parent = parent ? : clnt;
343 345
344 rcu_assign_pointer(clnt->cl_xprt, xprt); 346 rcu_assign_pointer(clnt->cl_xprt, xprt);
345 clnt->cl_procinfo = version->procs; 347 clnt->cl_procinfo = version->procs;
@@ -377,6 +379,8 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru
377 err = rpc_client_register(args, clnt); 379 err = rpc_client_register(args, clnt);
378 if (err) 380 if (err)
379 goto out_no_path; 381 goto out_no_path;
382 if (parent)
383 atomic_inc(&parent->cl_count);
380 return clnt; 384 return clnt;
381 385
382out_no_path: 386out_no_path:
@@ -467,7 +471,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
467 if (args->flags & RPC_CLNT_CREATE_NONPRIVPORT) 471 if (args->flags & RPC_CLNT_CREATE_NONPRIVPORT)
468 xprt->resvport = 0; 472 xprt->resvport = 0;
469 473
470 clnt = rpc_new_client(args, xprt); 474 clnt = rpc_new_client(args, xprt, NULL);
471 if (IS_ERR(clnt)) 475 if (IS_ERR(clnt))
472 return clnt; 476 return clnt;
473 477
@@ -514,15 +518,12 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
514 goto out_err; 518 goto out_err;
515 args->servername = xprt->servername; 519 args->servername = xprt->servername;
516 520
517 new = rpc_new_client(args, xprt); 521 new = rpc_new_client(args, xprt, clnt);
518 if (IS_ERR(new)) { 522 if (IS_ERR(new)) {
519 err = PTR_ERR(new); 523 err = PTR_ERR(new);
520 goto out_err; 524 goto out_err;
521 } 525 }
522 526
523 atomic_inc(&clnt->cl_count);
524 new->cl_parent = clnt;
525
526 /* Turn off autobind on clones */ 527 /* Turn off autobind on clones */
527 new->cl_autobind = 0; 528 new->cl_autobind = 0;
528 new->cl_softrtry = clnt->cl_softrtry; 529 new->cl_softrtry = clnt->cl_softrtry;