diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-21 10:12:39 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-21 10:12:39 -0400 |
commit | b3f87b98aa3dc22cc58f970140113b270015cddb (patch) | |
tree | c4aec5996567ad96310f61e9244e799f41bf2625 /net/sunrpc | |
parent | 041245c88a29273788e8eff1353bc6e1f56c61df (diff) | |
parent | 1afeaf5c29aa07db25760d2fbed5c08a3aec3498 (diff) |
Merge branch 'bugfixes' into nfs-for-next
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/auth_gss/gss_mech_switch.c | 7 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 16 | ||||
-rw-r--r-- | net/sunrpc/rpc_pipe.c | 8 | ||||
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 7 |
5 files changed, 25 insertions, 15 deletions
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index ca8cad8251c7..782bfe1b6465 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c | |||
@@ -242,12 +242,13 @@ EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor); | |||
242 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) | 242 | int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) |
243 | { | 243 | { |
244 | struct gss_api_mech *pos = NULL; | 244 | struct gss_api_mech *pos = NULL; |
245 | int i = 0; | 245 | int j, i = 0; |
246 | 246 | ||
247 | spin_lock(®istered_mechs_lock); | 247 | spin_lock(®istered_mechs_lock); |
248 | list_for_each_entry(pos, ®istered_mechs, gm_list) { | 248 | list_for_each_entry(pos, ®istered_mechs, gm_list) { |
249 | array_ptr[i] = pos->gm_pfs->pseudoflavor; | 249 | for (j=0; j < pos->gm_pf_num; j++) { |
250 | i++; | 250 | array_ptr[i++] = pos->gm_pfs[j].pseudoflavor; |
251 | } | ||
251 | } | 252 | } |
252 | spin_unlock(®istered_mechs_lock); | 253 | spin_unlock(®istered_mechs_lock); |
253 | return i; | 254 | return i; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index d127bd747527..25302c802460 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); |
@@ -1282,6 +1288,8 @@ call_reserveresult(struct rpc_task *task) | |||
1282 | } | 1288 | } |
1283 | 1289 | ||
1284 | switch (status) { | 1290 | switch (status) { |
1291 | case -ENOMEM: | ||
1292 | rpc_delay(task, HZ >> 2); | ||
1285 | case -EAGAIN: /* woken up; retry */ | 1293 | case -EAGAIN: /* woken up; retry */ |
1286 | task->tk_action = call_reserve; | 1294 | task->tk_action = call_reserve; |
1287 | return; | 1295 | return; |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index f955d7252e4f..88945d0f7594 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -120,7 +120,7 @@ EXPORT_SYMBOL_GPL(rpc_pipe_generic_upcall); | |||
120 | 120 | ||
121 | /** | 121 | /** |
122 | * rpc_queue_upcall - queue an upcall message to userspace | 122 | * rpc_queue_upcall - queue an upcall message to userspace |
123 | * @inode: inode of upcall pipe on which to queue given message | 123 | * @pipe: upcall pipe on which to queue given message |
124 | * @msg: message to queue | 124 | * @msg: message to queue |
125 | * | 125 | * |
126 | * Call with an @inode created by rpc_mkpipe() to queue an upcall. | 126 | * Call with an @inode created by rpc_mkpipe() to queue an upcall. |
@@ -819,9 +819,7 @@ static int rpc_rmdir_depopulate(struct dentry *dentry, | |||
819 | * @parent: dentry of directory to create new "pipe" in | 819 | * @parent: dentry of directory to create new "pipe" in |
820 | * @name: name of pipe | 820 | * @name: name of pipe |
821 | * @private: private data to associate with the pipe, for the caller's use | 821 | * @private: private data to associate with the pipe, for the caller's use |
822 | * @ops: operations defining the behavior of the pipe: upcall, downcall, | 822 | * @pipe: &rpc_pipe containing input parameters |
823 | * release_pipe, open_pipe, and destroy_msg. | ||
824 | * @flags: rpc_pipe flags | ||
825 | * | 823 | * |
826 | * Data is made available for userspace to read by calls to | 824 | * Data is made available for userspace to read by calls to |
827 | * rpc_queue_upcall(). The actual reads will result in calls to | 825 | * rpc_queue_upcall(). The actual reads will result in calls to |
@@ -943,7 +941,7 @@ struct dentry *rpc_create_client_dir(struct dentry *dentry, | |||
943 | 941 | ||
944 | /** | 942 | /** |
945 | * rpc_remove_client_dir - Remove a directory created with rpc_create_client_dir() | 943 | * rpc_remove_client_dir - Remove a directory created with rpc_create_client_dir() |
946 | * @clnt: rpc client | 944 | * @dentry: dentry for the pipe |
947 | */ | 945 | */ |
948 | int rpc_remove_client_dir(struct dentry *dentry) | 946 | int rpc_remove_client_dir(struct dentry *dentry) |
949 | { | 947 | { |
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 78ac39fd9fe7..3c0653439f3d 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -394,6 +394,7 @@ static int rpcb_register_call(struct rpc_clnt *clnt, struct rpc_message *msg) | |||
394 | 394 | ||
395 | /** | 395 | /** |
396 | * rpcb_register - set or unset a port registration with the local rpcbind svc | 396 | * rpcb_register - set or unset a port registration with the local rpcbind svc |
397 | * @net: target network namespace | ||
397 | * @prog: RPC program number to bind | 398 | * @prog: RPC program number to bind |
398 | * @vers: RPC version number to bind | 399 | * @vers: RPC version number to bind |
399 | * @prot: transport protocol to register | 400 | * @prot: transport protocol to register |
@@ -521,6 +522,7 @@ static int rpcb_unregister_all_protofamilies(struct sunrpc_net *sn, | |||
521 | 522 | ||
522 | /** | 523 | /** |
523 | * rpcb_v4_register - set or unset a port registration with the local rpcbind | 524 | * rpcb_v4_register - set or unset a port registration with the local rpcbind |
525 | * @net: target network namespace | ||
524 | * @program: RPC program number of service to (un)register | 526 | * @program: RPC program number of service to (un)register |
525 | * @version: RPC version number of service to (un)register | 527 | * @version: RPC version number of service to (un)register |
526 | * @address: address family, IP address, and port to (un)register | 528 | * @address: address family, IP address, and port to (un)register |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 0cbcd1ab49ab..d7ccd7923eab 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -979,20 +979,21 @@ static void xprt_alloc_slot(struct rpc_task *task) | |||
979 | list_del(&req->rq_list); | 979 | list_del(&req->rq_list); |
980 | goto out_init_req; | 980 | goto out_init_req; |
981 | } | 981 | } |
982 | req = xprt_dynamic_alloc_slot(xprt, GFP_NOWAIT); | 982 | req = xprt_dynamic_alloc_slot(xprt, GFP_NOWAIT|__GFP_NOWARN); |
983 | if (!IS_ERR(req)) | 983 | if (!IS_ERR(req)) |
984 | goto out_init_req; | 984 | goto out_init_req; |
985 | switch (PTR_ERR(req)) { | 985 | switch (PTR_ERR(req)) { |
986 | case -ENOMEM: | 986 | case -ENOMEM: |
987 | rpc_delay(task, HZ >> 2); | ||
988 | dprintk("RPC: dynamic allocation of request slot " | 987 | dprintk("RPC: dynamic allocation of request slot " |
989 | "failed! Retrying\n"); | 988 | "failed! Retrying\n"); |
989 | task->tk_status = -ENOMEM; | ||
990 | break; | 990 | break; |
991 | case -EAGAIN: | 991 | case -EAGAIN: |
992 | rpc_sleep_on(&xprt->backlog, task, NULL); | 992 | rpc_sleep_on(&xprt->backlog, task, NULL); |
993 | dprintk("RPC: waiting for request slot\n"); | 993 | dprintk("RPC: waiting for request slot\n"); |
994 | default: | ||
995 | task->tk_status = -EAGAIN; | ||
994 | } | 996 | } |
995 | task->tk_status = -EAGAIN; | ||
996 | return; | 997 | return; |
997 | out_init_req: | 998 | out_init_req: |
998 | task->tk_status = 0; | 999 | task->tk_status = 0; |