]> git.baikalelectronics.ru Git - kernel.git/commitdiff
SUNRPC: Don't take a reference to the cred on synchronous tasks
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Sat, 8 Feb 2020 00:16:34 +0000 (19:16 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 16 Mar 2020 12:34:29 +0000 (08:34 -0400)
If the RPC call is synchronous, assume the cred is already pinned
by the caller.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
net/sunrpc/clnt.c

index 2345e563c2f44d0fd68641ba8d530207d21c291c..252b044cdcdf8b1a07db0a678a481517e55dcea5 100644 (file)
@@ -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);