diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-26 19:23:04 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-08-30 09:19:36 -0400 |
commit | c2190661039b3817b4cc1cbfea620b3f7dbe5cd8 (patch) | |
tree | 61b8f6f287993f604c3a7843aa2322c36f375af9 /net/sunrpc/clnt.c | |
parent | bd4a3eb15bb42296e61d0fd16f2c7f8cc171b681 (diff) |
SUNRPC: Replace clnt->cl_principal
The clnt->cl_principal is being used exclusively to store the service
target name for RPCSEC_GSS/krb5 callbacks. Replace it with something that
is stored only in the RPCSEC_GSS-specific code.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 79d4bc2c316c..7407f1d86ebb 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -282,6 +282,10 @@ static void rpc_clnt_set_nodename(struct rpc_clnt *clnt, const char *nodename) | |||
282 | static int rpc_client_register(const struct rpc_create_args *args, | 282 | static int rpc_client_register(const struct rpc_create_args *args, |
283 | struct rpc_clnt *clnt) | 283 | struct rpc_clnt *clnt) |
284 | { | 284 | { |
285 | struct rpc_auth_create_args auth_args = { | ||
286 | .pseudoflavor = args->authflavor, | ||
287 | .target_name = args->client_name, | ||
288 | }; | ||
285 | struct rpc_auth *auth; | 289 | struct rpc_auth *auth; |
286 | struct net *net = rpc_net_ns(clnt); | 290 | struct net *net = rpc_net_ns(clnt); |
287 | struct super_block *pipefs_sb; | 291 | struct super_block *pipefs_sb; |
@@ -298,7 +302,7 @@ static int rpc_client_register(const struct rpc_create_args *args, | |||
298 | if (pipefs_sb) | 302 | if (pipefs_sb) |
299 | rpc_put_sb_net(net); | 303 | rpc_put_sb_net(net); |
300 | 304 | ||
301 | auth = rpcauth_create(args->authflavor, clnt); | 305 | auth = rpcauth_create(&auth_args, clnt); |
302 | if (IS_ERR(auth)) { | 306 | if (IS_ERR(auth)) { |
303 | dprintk("RPC: Couldn't create auth handle (flavor %u)\n", | 307 | dprintk("RPC: Couldn't create auth handle (flavor %u)\n", |
304 | args->authflavor); | 308 | args->authflavor); |
@@ -370,12 +374,6 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru | |||
370 | 374 | ||
371 | clnt->cl_rtt = &clnt->cl_rtt_default; | 375 | clnt->cl_rtt = &clnt->cl_rtt_default; |
372 | rpc_init_rtt(&clnt->cl_rtt_default, clnt->cl_timeout->to_initval); | 376 | rpc_init_rtt(&clnt->cl_rtt_default, clnt->cl_timeout->to_initval); |
373 | clnt->cl_principal = NULL; | ||
374 | if (args->client_name) { | ||
375 | clnt->cl_principal = kstrdup(args->client_name, GFP_KERNEL); | ||
376 | if (!clnt->cl_principal) | ||
377 | goto out_no_principal; | ||
378 | } | ||
379 | 377 | ||
380 | atomic_set(&clnt->cl_count, 1); | 378 | atomic_set(&clnt->cl_count, 1); |
381 | 379 | ||
@@ -388,8 +386,6 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru | |||
388 | return clnt; | 386 | return clnt; |
389 | 387 | ||
390 | out_no_path: | 388 | out_no_path: |
391 | kfree(clnt->cl_principal); | ||
392 | out_no_principal: | ||
393 | rpc_free_iostats(clnt->cl_metrics); | 389 | rpc_free_iostats(clnt->cl_metrics); |
394 | out_no_stats: | 390 | out_no_stats: |
395 | kfree(clnt); | 391 | kfree(clnt); |
@@ -559,7 +555,6 @@ struct rpc_clnt *rpc_clone_client(struct rpc_clnt *clnt) | |||
559 | .prognumber = clnt->cl_prog, | 555 | .prognumber = clnt->cl_prog, |
560 | .version = clnt->cl_vers, | 556 | .version = clnt->cl_vers, |
561 | .authflavor = clnt->cl_auth->au_flavor, | 557 | .authflavor = clnt->cl_auth->au_flavor, |
562 | .client_name = clnt->cl_principal, | ||
563 | }; | 558 | }; |
564 | return __rpc_clone_client(&args, clnt); | 559 | return __rpc_clone_client(&args, clnt); |
565 | } | 560 | } |
@@ -581,7 +576,6 @@ rpc_clone_client_set_auth(struct rpc_clnt *clnt, rpc_authflavor_t flavor) | |||
581 | .prognumber = clnt->cl_prog, | 576 | .prognumber = clnt->cl_prog, |
582 | .version = clnt->cl_vers, | 577 | .version = clnt->cl_vers, |
583 | .authflavor = flavor, | 578 | .authflavor = flavor, |
584 | .client_name = clnt->cl_principal, | ||
585 | }; | 579 | }; |
586 | return __rpc_clone_client(&args, clnt); | 580 | return __rpc_clone_client(&args, clnt); |
587 | } | 581 | } |
@@ -654,7 +648,6 @@ rpc_free_client(struct rpc_clnt *clnt) | |||
654 | rpc_clnt_remove_pipedir(clnt); | 648 | rpc_clnt_remove_pipedir(clnt); |
655 | rpc_unregister_client(clnt); | 649 | rpc_unregister_client(clnt); |
656 | rpc_free_iostats(clnt->cl_metrics); | 650 | rpc_free_iostats(clnt->cl_metrics); |
657 | kfree(clnt->cl_principal); | ||
658 | clnt->cl_metrics = NULL; | 651 | clnt->cl_metrics = NULL; |
659 | xprt_put(rcu_dereference_raw(clnt->cl_xprt)); | 652 | xprt_put(rcu_dereference_raw(clnt->cl_xprt)); |
660 | rpciod_down(); | 653 | rpciod_down(); |
@@ -718,7 +711,6 @@ struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *old, | |||
718 | .prognumber = program->number, | 711 | .prognumber = program->number, |
719 | .version = vers, | 712 | .version = vers, |
720 | .authflavor = old->cl_auth->au_flavor, | 713 | .authflavor = old->cl_auth->au_flavor, |
721 | .client_name = old->cl_principal, | ||
722 | }; | 714 | }; |
723 | struct rpc_clnt *clnt; | 715 | struct rpc_clnt *clnt; |
724 | int err; | 716 | int err; |