summaryrefslogtreecommitdiff
path: root/net/sunrpc/xprtrdma/svc_rdma_marshal.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2016-03-01 21:06:38 +0300
committerJ. Bruce Fields <bfields@redhat.com>2016-03-02 00:06:38 +0300
commita6081b82c533d78041acb76738716aa7dafb339a (patch)
tree2d7d5f64b01bbf23494b1dc2de84ac9e21552e9d /net/sunrpc/xprtrdma/svc_rdma_marshal.c
parentc6db03ea577846a72dc80638f4a70b392c21962f (diff)
downloadlinux-a6081b82c533d78041acb76738716aa7dafb339a.tar.xz
svcrdma: Make RDMA_ERROR messages work
Fix several issues with svc_rdma_send_error(): - Post a receive buffer to replace the one that was consumed by the incoming request - Posting a send should use DMA_TO_DEVICE, not DMA_FROM_DEVICE - No need to put_page _and_ free pages in svc_rdma_put_context - Make sure the sge is set up completely in case the error path goes through svc_rdma_unmap_dma() - Replace the use of ENOSYS, which has a reserved meaning Related fixes in svc_rdma_recvfrom(): - Don't leak the ctxt associated with the incoming request - Don't close the connection after sending an error reply - Let svc_rdma_send_error() figure out the right header error code As a last clean up, move svc_rdma_send_error() to svc_rdma_sendto.c with other similar functions. There is some common logic in these functions that could someday be combined to reduce code duplication. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Devesh Sharma <devesh.sharma@broadcom.com> Tested-by: Devesh Sharma <devesh.sharma@broadcom.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/svc_rdma_marshal.c')
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_marshal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_marshal.c b/net/sunrpc/xprtrdma/svc_rdma_marshal.c
index e2fca7617242..f74fc523d95b 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_marshal.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_marshal.c
@@ -162,7 +162,7 @@ int svc_rdma_xdr_decode_req(struct rpcrdma_msg **rdma_req,
}
if (rmsgp->rm_vers != rpcrdma_version)
- return -ENOSYS;
+ return -EPROTONOSUPPORT;
/* Pull in the extra for the padded case and bump our pointer */
if (rmsgp->rm_type == rdma_msgp) {