svcrdma: svc_rdma_post_recv() should close connection on error
Clean up: Most svc_rdma_post_recv() call sites close the transport connection when a receive cannot be posted. Wrap that in a common helper. 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>
This commit is contained in:

committed by
J. Bruce Fields

parent
3e1eeb9808
commit
bf36387ad3
@@ -475,13 +475,8 @@ static int send_reply(struct svcxprt_rdma *rdma,
|
||||
int pages;
|
||||
int ret;
|
||||
|
||||
/* Post a recv buffer to handle another request. */
|
||||
ret = svc_rdma_post_recv(rdma, GFP_KERNEL);
|
||||
ret = svc_rdma_repost_recv(rdma, GFP_KERNEL);
|
||||
if (ret) {
|
||||
printk(KERN_INFO
|
||||
"svcrdma: could not post a receive buffer, err=%d."
|
||||
"Closing transport %p.\n", ret, rdma);
|
||||
set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags);
|
||||
svc_rdma_put_context(ctxt, 0);
|
||||
return -ENOTCONN;
|
||||
}
|
||||
|
Reference in New Issue
Block a user