Skip to content

Commit a40e6f0

Browse files
metze-sambasmfrench
authored andcommitted
smb: smbdirect: wrap rdma_disconnect() in rdma_[un]lock_handler()
This might not be needed, but it controls the order of ib_drain_qp() and rdma_disconnect(). Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher <metze@samba.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 33b2894 commit a40e6f0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

fs/smb/common/smbdirect/smbdirect_socket.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,20 @@ static void smbdirect_socket_cleanup_work(struct work_struct *work)
474474
case SMBDIRECT_SOCKET_CONNECTED:
475475
case SMBDIRECT_SOCKET_ERROR:
476476
sc->status = SMBDIRECT_SOCKET_DISCONNECTING;
477+
/*
478+
* Make sure we hold the callback lock
479+
* im order to coordinate with the
480+
* rdma_event handlers, typically
481+
* smbdirect_connection_rdma_event_handler(),
482+
* and smbdirect_socket_destroy().
483+
*
484+
* So that the order of ib_drain_qp()
485+
* and rdma_disconnect() is controlled
486+
* by the mutex.
487+
*/
488+
rdma_lock_handler(sc->rdma.cm_id);
477489
rdma_disconnect(sc->rdma.cm_id);
490+
rdma_unlock_handler(sc->rdma.cm_id);
478491
break;
479492

480493
case SMBDIRECT_SOCKET_CREATED:

0 commit comments

Comments
 (0)