Skip to content

Commit

Permalink
SUNRPC: Avoid RCU dereferences in the transport bind and connect code
Browse files Browse the repository at this point in the history
Avoid an RCU dereference by removing task->tk_xprt

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Feb 1, 2013
1 parent 45bc0dc commit ad2368d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -1602,7 +1602,7 @@ call_bind_status(struct rpc_task *task)
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,
Expand Down
4 changes: 2 additions & 2 deletions net/sunrpc/xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ xprt_init_autodisconnect(unsigned long data)
*/
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"));
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit ad2368d

Please sign in to comment.