Skip to content

Commit d451a0e

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: let smbd_destroy() wait for SMBDIRECT_SOCKET_DISCONNECTED
We should wait for the rdma_cm to become SMBDIRECT_SOCKET_DISCONNECTED, it turns out that (at least running some xfstests e.g. cifs/001) often triggers the case where wait_event_interruptible() returns with -ERESTARTSYS instead of waiting for SMBDIRECT_SOCKET_DISCONNECTED to be reached. Or we are already in SMBDIRECT_SOCKET_DISCONNECTING and never wait for SMBDIRECT_SOCKET_DISCONNECTED. Fixes: 050b8c3 ("smbd: Make upper layer decide when to destroy the transport") Fixes: e8b3bfe ("cifs: smbd: Don't destroy transport on RDMA disconnect") Fixes: b0aa92a ("smb: client: make sure smbd_disconnect_rdma_work() doesn't run after smbd_destroy() took over") 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> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent d877470 commit d451a0e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/smb/client/smbdirect.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,12 +1575,12 @@ void smbd_destroy(struct TCP_Server_Info *server)
15751575
disable_work_sync(&sc->disconnect_work);
15761576

15771577
log_rdma_event(INFO, "destroying rdma session\n");
1578-
if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING) {
1578+
if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING)
15791579
smbd_disconnect_rdma_work(&sc->disconnect_work);
1580+
if (sc->status < SMBDIRECT_SOCKET_DISCONNECTED) {
15801581
log_rdma_event(INFO, "wait for transport being disconnected\n");
1581-
wait_event_interruptible(
1582-
sc->status_wait,
1583-
sc->status == SMBDIRECT_SOCKET_DISCONNECTED);
1582+
wait_event(sc->status_wait, sc->status == SMBDIRECT_SOCKET_DISCONNECTED);
1583+
log_rdma_event(INFO, "waited for transport being disconnected\n");
15841584
}
15851585

15861586
/*

0 commit comments

Comments
 (0)