linux-stable/net/sunrpc/xprtrdma
Chuck Lever 5fe6eaa1f9 SUNRPC: Generalize the RPC buffer allocation API
xprtrdma needs to allocate the Call and Reply buffers separately.
TBH, the reliance on using a single buffer for the pair of XDR
buffers is transport implementation-specific.

Transports that want to allocate separate Call and Reply buffers
will ignore the "size" argument anyway.  Don't bother passing it.

The buf_alloc method can't return two pointers. Instead, make the
method's return value an error code, and set the rq_buffer pointer
in the method itself.

This gives call_allocate an opportunity to terminate an RPC instead
of looping forever when a permanent problem occurs. If a request is
just bogus, or the transport is in a state where it can't allocate
resources for any request, there needs to be a way to kill the RPC
right there and not loop.

This immediately fixes a rare problem in the backchannel send path,
which loops if the server happens to send a CB request whose
call+reply size is larger than a page (which it shouldn't do yet).

One more issue: looks like xprt_inject_disconnect was incorrectly
placed in the failure path in call_allocate. It needs to be in the
success path, as it is for other call-sites.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2016-09-19 13:08:37 -04:00
..
backchannel.c SUNRPC: Refactor rpc_xdr_buf_init() 2016-09-19 13:08:37 -04:00
fmr_ops.c xprtrdma: Place registered MWs on a per-req list 2016-07-11 15:50:43 -04:00
frwr_ops.c xprtrdma: Place registered MWs on a per-req list 2016-07-11 15:50:43 -04:00
Makefile xprtrdma: Remove ALLPHYSICAL memory registration mode 2016-07-11 15:50:43 -04:00
module.c rpcrdma: Merge svcrdma and xprtrdma modules into one 2015-06-04 16:56:02 -04:00
rpc_rdma.c xprtrdma: Eliminate INLINE_THRESHOLD macros 2016-09-19 13:08:37 -04:00
svc_rdma.c svcrdma: Define maximum number of backchannel requests 2016-01-19 15:30:48 -05:00
svc_rdma_backchannel.c SUNRPC: Generalize the RPC buffer allocation API 2016-09-19 13:08:37 -04:00
svc_rdma_marshal.c svcrdma: Generalize svc_rdma_xdr_decode_req() 2016-05-13 15:53:06 -04:00
svc_rdma_recvfrom.c A very quiet cycle for nfsd, mainly just an RDMA update from Chuck Lever. 2016-05-24 14:39:20 -07:00
svc_rdma_sendto.c svcrdma: svc_rdma_put_context() is invoked twice in Send error path 2016-05-13 15:53:05 -04:00
svc_rdma_transport.c svcrdma: Drain QP before freeing svcrdma_xprt 2016-05-13 15:53:06 -04:00
transport.c SUNRPC: Generalize the RPC buffer allocation API 2016-09-19 13:08:37 -04:00
verbs.c xprtrdma: Fix receive buffer accounting 2016-09-06 15:59:35 -04:00
xprt_rdma.h xprtrdma: Eliminate INLINE_THRESHOLD macros 2016-09-19 13:08:37 -04:00