SUNRPC: Avoid RCU dereferences in the transport bind and connect code
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 8 Jan 2013 15:08:33 +0000 (10:08 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 1 Feb 2013 15:13:47 +0000 (10:13 -0500)
Avoid an RCU dereference by removing task->tk_xprt

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/clnt.c
net/sunrpc/xprt.c

index 6b3411ba23f132a4d83f5d36d76fb6f8fe0202a4..a9f7906c1a6ad251d4881bb731632d695449a720 100644 (file)
@@ -1508,7 +1508,7 @@ rpc_xdr_encode(struct rpc_task *task)
 static void
 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);
 
@@ -1602,7 +1602,7 @@ retry_timeout:
 static void
 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",
                        task->tk_pid, xprt,
index 7f3a01a8cae760cc852226e07909367bc2ce969e..846c34fdee9f496c1e94ccbdcfe306eefe35d0d0 100644 (file)
@@ -697,7 +697,7 @@ out_abort:
  */
 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,
                        xprt, (xprt_connected(xprt) ? "is" : "is not"));
@@ -730,7 +730,7 @@ void xprt_connect(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) {
                xprt->stat.connect_count++;