aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sunrpc/clnt.c11
-rw-r--r--net/sunrpc/sched.c11
2 files changed, 15 insertions, 7 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 7aeffeebf42d..6eb79c49c937 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -540,13 +540,10 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *task_setup_data)
540 goto out; 540 goto out;
541 } 541 }
542 542
543 if (task_setup_data->rpc_message != NULL) { 543 if (task->tk_status != 0) {
544 rpc_call_setup(task, task_setup_data->rpc_message, 0); 544 ret = ERR_PTR(task->tk_status);
545 if (task->tk_status != 0) { 545 rpc_put_task(task);
546 ret = ERR_PTR(task->tk_status); 546 goto out;
547 rpc_put_task(task);
548 goto out;
549 }
550 } 547 }
551 atomic_inc(&task->tk_count); 548 atomic_inc(&task->tk_count);
552 /* Mask signals on synchronous RPC calls and RPCSEC_GSS upcalls */ 549 /* Mask signals on synchronous RPC calls and RPCSEC_GSS upcalls */
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index b9061bcf6fc1..fa53a88b2c5b 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -848,6 +848,17 @@ void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *task_setu
848 if (task->tk_ops->rpc_call_prepare != NULL) 848 if (task->tk_ops->rpc_call_prepare != NULL)
849 task->tk_action = rpc_prepare_task; 849 task->tk_action = rpc_prepare_task;
850 850
851 if (task_setup_data->rpc_message != NULL) {
852 memcpy(&task->tk_msg, task_setup_data->rpc_message, sizeof(task->tk_msg));
853 /* Bind the user cred */
854 if (task->tk_msg.rpc_cred != NULL)
855 rpcauth_holdcred(task);
856 else
857 rpcauth_bindcred(task);
858 if (task->tk_action == NULL)
859 rpc_call_start(task);
860 }
861
851 /* starting timestamp */ 862 /* starting timestamp */
852 task->tk_start = jiffies; 863 task->tk_start = jiffies;
853 864