Commit a06eca42 authored by Dominique Martinet's avatar Dominique Martinet Committed by Stefan Bader

9p/rdma: do not disconnect on down_interruptible EAGAIN

BugLink: https://bugs.launchpad.net/bugs/1836668

[ Upstream commit 8b894adb ]

9p/rdma would sometimes drop the connection and display errors in
recv_done when the user does ^C.
The errors were caused by recv buffers that were posted at the time
of disconnect, and we just do not want to disconnect when
down_interruptible is... interrupted.

Link: http://lkml.kernel.org/r/1535625307-18019-1-git-send-email-asmadeus@codewreck.orgSigned-off-by: default avatarDominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent ddfa09da
...@@ -476,7 +476,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) ...@@ -476,7 +476,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
err = post_recv(client, rpl_context); err = post_recv(client, rpl_context);
if (err) { if (err) {
p9_debug(P9_DEBUG_FCALL, "POST RECV failed\n"); p9_debug(P9_DEBUG_ERROR, "POST RECV failed: %d\n", err);
goto recv_error; goto recv_error;
} }
/* remove posted receive buffer from request structure */ /* remove posted receive buffer from request structure */
...@@ -544,7 +544,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req) ...@@ -544,7 +544,7 @@ static int rdma_request(struct p9_client *client, struct p9_req_t *req)
recv_error: recv_error:
kfree(rpl_context); kfree(rpl_context);
spin_lock_irqsave(&rdma->req_lock, flags); spin_lock_irqsave(&rdma->req_lock, flags);
if (rdma->state < P9_RDMA_CLOSING) { if (err != -EINTR && rdma->state < P9_RDMA_CLOSING) {
rdma->state = P9_RDMA_CLOSING; rdma->state = P9_RDMA_CLOSING;
spin_unlock_irqrestore(&rdma->req_lock, flags); spin_unlock_irqrestore(&rdma->req_lock, flags);
rdma_disconnect(rdma->cm_id); rdma_disconnect(rdma->cm_id);
......
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