Skip to content

Commit

Permalink
cifs: smbd: disconnect transport on RDMA errors
Browse files Browse the repository at this point in the history
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: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
  • Loading branch information
Long Li authored and Steve French committed Apr 2, 2018
1 parent 48f238a commit 21a4e14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/cifs/smbdirect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
request->sge[0].length, DMA_TO_DEVICE);

smbd_disconnect_rdma_connection(info);

dma_mapping_failed:
mempool_free(request, info->request_mempool);
return rc;
Expand Down Expand Up @@ -1061,6 +1063,7 @@ static int smbd_post_send(struct smbd_connection *info,
if (atomic_dec_and_test(&info->send_pending))
wake_up(&info->wait_send_pending);
}
smbd_disconnect_rdma_connection(info);
} else
/* Reset timer for idle connection after packet is sent */
mod_delayed_work(info->workqueue, &info->idle_timer_work,
Expand Down Expand Up @@ -1202,7 +1205,7 @@ static int smbd_post_recv(
if (rc) {
ib_dma_unmap_single(info->id->device, response->sge.addr,
response->sge.length, DMA_FROM_DEVICE);

smbd_disconnect_rdma_connection(info);
log_rdma_recv(ERR, "ib_post_recv failed rc=%d\n", rc);
}

Expand Down Expand Up @@ -2546,6 +2549,8 @@ struct smbd_mr *smbd_register_mr(
if (atomic_dec_and_test(&info->mr_used_count))
wake_up(&info->wait_for_mr_cleanup);

smbd_disconnect_rdma_connection(info);

return NULL;
}

Expand Down

0 comments on commit 21a4e14

Please sign in to comment.