Commit 3e1eeb98 authored by Chuck Lever's avatar Chuck Lever Committed by J. Bruce Fields

svcrdma: Close connection when a send error occurs

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 4500632f
...@@ -314,7 +314,6 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp, ...@@ -314,7 +314,6 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
err: err:
svc_rdma_unmap_dma(ctxt); svc_rdma_unmap_dma(ctxt);
svc_rdma_put_context(ctxt, 0); svc_rdma_put_context(ctxt, 0);
/* Fatal error, close transport */
return -EIO; return -EIO;
} }
...@@ -571,6 +570,7 @@ static int send_reply(struct svcxprt_rdma *rdma, ...@@ -571,6 +570,7 @@ static int send_reply(struct svcxprt_rdma *rdma,
err: err:
svc_rdma_unmap_dma(ctxt); svc_rdma_unmap_dma(ctxt);
svc_rdma_put_context(ctxt, 1); svc_rdma_put_context(ctxt, 1);
pr_err("svcrdma: failed to send reply, rc=%d\n", ret);
return -EIO; return -EIO;
} }
...@@ -642,6 +642,9 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) ...@@ -642,6 +642,9 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
ret = send_reply(rdma, rqstp, res_page, rdma_resp, ctxt, vec, ret = send_reply(rdma, rqstp, res_page, rdma_resp, ctxt, vec,
inline_bytes); inline_bytes);
if (ret < 0)
goto err1;
svc_rdma_put_req_map(rdma, vec); svc_rdma_put_req_map(rdma, vec);
dprintk("svcrdma: send_reply returns %d\n", ret); dprintk("svcrdma: send_reply returns %d\n", ret);
return ret; return ret;
...@@ -651,5 +654,6 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) ...@@ -651,5 +654,6 @@ int svc_rdma_sendto(struct svc_rqst *rqstp)
err0: err0:
svc_rdma_put_req_map(rdma, vec); svc_rdma_put_req_map(rdma, vec);
svc_rdma_put_context(ctxt, 0); svc_rdma_put_context(ctxt, 0);
return ret; set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
return -ENOTCONN;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment