aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2020-02-07 19:16:34 -0500
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-03-16 08:34:29 -0400
commit263fb9c21e7a86e8e373a23edfa82700422f5e6a (patch)
tree715aa153fa71ce81925ea7ac8f4393b25ae5dd89 /net/sunrpc/clnt.c
parent7eac52648a4c24ad23a05f62db97867c92a5747b (diff)
downloadlinux-263fb9c21e7a86e8e373a23edfa82700422f5e6a.tar.gz
SUNRPC: Don't take a reference to the cred on synchronous tasks
If the RPC call is synchronous, assume the cred is already pinned by the caller. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'net/sunrpc/clnt.c')
-rw-r--r--net/sunrpc/clnt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 2345e563c2f44d..252b044cdcdf8b 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -1127,6 +1127,9 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *task_setup_data)
task = rpc_new_task(task_setup_data);
+ if (!RPC_IS_ASYNC(task))
+ task->tk_flags |= RPC_TASK_CRED_NOREF;
+
rpc_task_set_client(task, task_setup_data->rpc_client);
rpc_task_set_rpc_message(task, task_setup_data->rpc_message);