Commit 45bc0dce authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Fix an RCU dereference in xprt_reserve

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 6a24dfb6
...@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(xprt_free); ...@@ -1093,7 +1093,7 @@ EXPORT_SYMBOL_GPL(xprt_free);
*/ */
void xprt_reserve(struct rpc_task *task) void xprt_reserve(struct rpc_task *task)
{ {
struct rpc_xprt *xprt = task->tk_xprt; struct rpc_xprt *xprt;
task->tk_status = 0; task->tk_status = 0;
if (task->tk_rqstp != NULL) if (task->tk_rqstp != NULL)
...@@ -1101,7 +1101,10 @@ void xprt_reserve(struct rpc_task *task) ...@@ -1101,7 +1101,10 @@ void xprt_reserve(struct rpc_task *task)
task->tk_timeout = 0; task->tk_timeout = 0;
task->tk_status = -EAGAIN; task->tk_status = -EAGAIN;
rcu_read_lock();
xprt = rcu_dereference(task->tk_client->cl_xprt);
xprt->ops->alloc_slot(xprt, task); xprt->ops->alloc_slot(xprt, task);
rcu_read_unlock();
} }
static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt) static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment