Skip to content

Commit

Permalink
xprtrdma: xprt_rdma_free() must not release backchannel reqs
Browse files Browse the repository at this point in the history
Preserve any rpcrdma_req that is attached to rpc_rqst's allocated
for the backchannel. Otherwise, after all the pre-allocated
backchannel req's are consumed, incoming backward calls start
writing on freed memory.

Somehow this hunk got lost.

Fixes: f531a5d ('xprtrdma: Pre-allocate backward rpc_rqst')
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Devesh Sharma <devesh.sharma@avagotech.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Chuck Lever authored and Anna Schumaker committed Dec 18, 2015
1 parent 9b06688 commit ffc4d9b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,9 @@ xprt_rdma_free(void *buffer)

rb = container_of(buffer, struct rpcrdma_regbuf, rg_base[0]);
req = rb->rg_owner;
if (req->rl_backchannel)
return;

r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf);

dprintk("RPC: %s: called on 0x%p\n", __func__, req->rl_reply);
Expand Down

0 comments on commit ffc4d9b

Please sign in to comment.