Skip to content

Commit

Permalink
SUNRPC: Fix a nfs4 over rdma transport oops
Browse files Browse the repository at this point in the history
Prevent an RPC oops when freeing a dynamically allocated RDMA
buffer, used in certain special-case large metadata operations.

Signed-off-by: Tom Talpey <tmt@netapp.com>
Signed-off-by: James Lentini <jlentini@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Tom Talpey authored and Trond Myklebust committed Mar 7, 2008
1 parent af1b8c2 commit ee1a2c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ xprt_rdma_free(void *buffer)
return;

req = container_of(buffer, struct rpcrdma_req, rl_xdr_buf[0]);
r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf);
if (req->rl_iov.length == 0) { /* see allocate above */
r_xprt = container_of(((struct rpcrdma_req *) req->rl_buffer)->rl_buffer,
struct rpcrdma_xprt, rx_buf);
} else
r_xprt = container_of(req->rl_buffer, struct rpcrdma_xprt, rx_buf);
rep = req->rl_reply;

dprintk("RPC: %s: called on 0x%p%s\n",
Expand Down

0 comments on commit ee1a2c5

Please sign in to comment.