diff options
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r-- | net/sunrpc/clnt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d127bd747527..adf2990acebf 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -279,6 +279,14 @@ void rpc_clients_notifier_unregister(void) | |||
279 | return rpc_pipefs_notifier_unregister(&rpc_clients_block); | 279 | return rpc_pipefs_notifier_unregister(&rpc_clients_block); |
280 | } | 280 | } |
281 | 281 | ||
282 | static void rpc_clnt_set_nodename(struct rpc_clnt *clnt, const char *nodename) | ||
283 | { | ||
284 | clnt->cl_nodelen = strlen(nodename); | ||
285 | if (clnt->cl_nodelen > UNX_MAXNODENAME) | ||
286 | clnt->cl_nodelen = UNX_MAXNODENAME; | ||
287 | memcpy(clnt->cl_nodename, nodename, clnt->cl_nodelen); | ||
288 | } | ||
289 | |||
282 | static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) | 290 | static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, struct rpc_xprt *xprt) |
283 | { | 291 | { |
284 | const struct rpc_program *program = args->program; | 292 | const struct rpc_program *program = args->program; |
@@ -359,10 +367,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args, stru | |||
359 | } | 367 | } |
360 | 368 | ||
361 | /* save the nodename */ | 369 | /* save the nodename */ |
362 | clnt->cl_nodelen = strlen(init_utsname()->nodename); | 370 | rpc_clnt_set_nodename(clnt, utsname()->nodename); |
363 | if (clnt->cl_nodelen > UNX_MAXNODENAME) | ||
364 | clnt->cl_nodelen = UNX_MAXNODENAME; | ||
365 | memcpy(clnt->cl_nodename, init_utsname()->nodename, clnt->cl_nodelen); | ||
366 | rpc_register_client(clnt); | 371 | rpc_register_client(clnt); |
367 | return clnt; | 372 | return clnt; |
368 | 373 | ||
@@ -521,6 +526,7 @@ rpc_clone_client(struct rpc_clnt *clnt) | |||
521 | err = rpc_setup_pipedir(new, clnt->cl_program->pipe_dir_name); | 526 | err = rpc_setup_pipedir(new, clnt->cl_program->pipe_dir_name); |
522 | if (err != 0) | 527 | if (err != 0) |
523 | goto out_no_path; | 528 | goto out_no_path; |
529 | rpc_clnt_set_nodename(new, utsname()->nodename); | ||
524 | if (new->cl_auth) | 530 | if (new->cl_auth) |
525 | atomic_inc(&new->cl_auth->au_count); | 531 | atomic_inc(&new->cl_auth->au_count); |
526 | atomic_inc(&clnt->cl_count); | 532 | atomic_inc(&clnt->cl_count); |