Commit 21a4e14a authored by Long Li's avatar Long Li Committed by Steve French

cifs: smbd: disconnect transport on RDMA errors

On RDMA errors, transport should disconnect the RDMA CM connection. This
will notify the upper layer, and it will attempt transport reconnect.
Signed-off-by: default avatarLong Li <longli@microsoft.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
Reviewed-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
parent 48f238a7
...@@ -862,6 +862,8 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info) ...@@ -862,6 +862,8 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info)
ib_dma_unmap_single(info->id->device, request->sge[0].addr, ib_dma_unmap_single(info->id->device, request->sge[0].addr,
request->sge[0].length, DMA_TO_DEVICE); request->sge[0].length, DMA_TO_DEVICE);
smbd_disconnect_rdma_connection(info);
dma_mapping_failed: dma_mapping_failed:
mempool_free(request, info->request_mempool); mempool_free(request, info->request_mempool);
return rc; return rc;
...@@ -1061,6 +1063,7 @@ static int smbd_post_send(struct smbd_connection *info, ...@@ -1061,6 +1063,7 @@ static int smbd_post_send(struct smbd_connection *info,
if (atomic_dec_and_test(&info->send_pending)) if (atomic_dec_and_test(&info->send_pending))
wake_up(&info->wait_send_pending); wake_up(&info->wait_send_pending);
} }
smbd_disconnect_rdma_connection(info);
} else } else
/* Reset timer for idle connection after packet is sent */ /* Reset timer for idle connection after packet is sent */
mod_delayed_work(info->workqueue, &info->idle_timer_work, mod_delayed_work(info->workqueue, &info->idle_timer_work,
...@@ -1202,7 +1205,7 @@ static int smbd_post_recv( ...@@ -1202,7 +1205,7 @@ static int smbd_post_recv(
if (rc) { if (rc) {
ib_dma_unmap_single(info->id->device, response->sge.addr, ib_dma_unmap_single(info->id->device, response->sge.addr,
response->sge.length, DMA_FROM_DEVICE); response->sge.length, DMA_FROM_DEVICE);
smbd_disconnect_rdma_connection(info);
log_rdma_recv(ERR, "ib_post_recv failed rc=%d\n", rc); log_rdma_recv(ERR, "ib_post_recv failed rc=%d\n", rc);
} }
...@@ -2546,6 +2549,8 @@ struct smbd_mr *smbd_register_mr( ...@@ -2546,6 +2549,8 @@ struct smbd_mr *smbd_register_mr(
if (atomic_dec_and_test(&info->mr_used_count)) if (atomic_dec_and_test(&info->mr_used_count))
wake_up(&info->wait_for_mr_cleanup); wake_up(&info->wait_for_mr_cleanup);
smbd_disconnect_rdma_connection(info);
return NULL; return NULL;
} }
......
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