]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: server: let free_transport() wait for SMBDIRECT_SOCKET_DISCONNECTED
authorStefan Metzmacher <metze@samba.org>
Wed, 15 Oct 2025 15:05:27 +0000 (17:05 +0200)
committerSteve French <stfrench@microsoft.com>
Fri, 24 Oct 2025 01:58:51 +0000 (20:58 -0500)
We should wait for the rdma_cm to become SMBDIRECT_SOCKET_DISCONNECTED!

At least on the client side (with similar code)
wait_event_interruptible() often returns with -ERESTARTSYS instead of
waiting for SMBDIRECT_SOCKET_DISCONNECTED.
We should use wait_event() here too, which makes the code be identical
in client and server, which will help when moving to common functions.

Fixes: b31606097de8 ("smb: server: move smb_direct_disconnect_rdma_work() into free_transport()")
Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
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>
fs/smb/server/transport_rdma.c

index 8aaa950a944904eeddfb6d2684a459272c12f1e9..89b02efdba0c19d8003b69081a70c7da0b649720 100644 (file)
@@ -451,11 +451,10 @@ static void free_transport(struct smb_direct_transport *t)
        struct smbdirect_recv_io *recvmsg;
 
        disable_work_sync(&sc->disconnect_work);
-       if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING) {
+       if (sc->status < SMBDIRECT_SOCKET_DISCONNECTING)
                smb_direct_disconnect_rdma_work(&sc->disconnect_work);
-               wait_event_interruptible(sc->status_wait,
-                                        sc->status == SMBDIRECT_SOCKET_DISCONNECTED);
-       }
+       if (sc->status < SMBDIRECT_SOCKET_DISCONNECTED)
+               wait_event(sc->status_wait, sc->status == SMBDIRECT_SOCKET_DISCONNECTED);
 
        /*
         * Wake up all waiters in all wait queues