Commit ad2368d6 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Avoid RCU dereferences in the transport bind and connect code

Avoid an RCU dereference by removing task->tk_xprt
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 45bc0dce
...@@ -1508,7 +1508,7 @@ rpc_xdr_encode(struct rpc_task *task) ...@@ -1508,7 +1508,7 @@ rpc_xdr_encode(struct rpc_task *task)
static void static void
call_bind(struct rpc_task *task) call_bind(struct rpc_task *task)
{ {
struct rpc_xprt *xprt = task->tk_xprt; struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprint_status(task); dprint_status(task);
...@@ -1602,7 +1602,7 @@ call_bind_status(struct rpc_task *task) ...@@ -1602,7 +1602,7 @@ call_bind_status(struct rpc_task *task)
static void static void
call_connect(struct rpc_task *task) call_connect(struct rpc_task *task)
{ {
struct rpc_xprt *xprt = task->tk_xprt; struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u call_connect xprt %p %s connected\n", dprintk("RPC: %5u call_connect xprt %p %s connected\n",
task->tk_pid, xprt, task->tk_pid, xprt,
......
...@@ -697,7 +697,7 @@ xprt_init_autodisconnect(unsigned long data) ...@@ -697,7 +697,7 @@ xprt_init_autodisconnect(unsigned long data)
*/ */
void xprt_connect(struct rpc_task *task) void xprt_connect(struct rpc_task *task)
{ {
struct rpc_xprt *xprt = task->tk_xprt; struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid,
xprt, (xprt_connected(xprt) ? "is" : "is not")); xprt, (xprt_connected(xprt) ? "is" : "is not"));
...@@ -730,7 +730,7 @@ void xprt_connect(struct rpc_task *task) ...@@ -730,7 +730,7 @@ void xprt_connect(struct rpc_task *task)
static void xprt_connect_status(struct rpc_task *task) static void xprt_connect_status(struct rpc_task *task)
{ {
struct rpc_xprt *xprt = task->tk_xprt; struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt;
if (task->tk_status == 0) { if (task->tk_status == 0) {
xprt->stat.connect_count++; xprt->stat.connect_count++;
......
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