smb: client: make sure smbd_disconnect_rdma_work() doesn't run after smbd_destroy...
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Aug 2025 07:10:07 +0000 (09:10 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:49 +0000 (18:29 -0500)
commitb0aa92a229ab9e6de3839e06f3a8494bce5b1cd2
tree9221182d73c704566d7d5e554ba1692a22da216d
parent9b1a6b7583cb71e101a93e518e2cbc32911a2b89
smb: client: make sure smbd_disconnect_rdma_work() doesn't run after smbd_destroy() took over

If we're already disconnecting we don't need to queue the
disconnect_work again. disable_work() turns the next queue_work()
into a no-op.

Also let smbd_destroy() cancel(and disable) queued disconnect_work and
call smbd_disconnect_rdma_work() inline.

The makes it more obvious that disconnect_work is never queued
again after smbd_destroy() called smbd_disconnect_rdma_work().

It also means we have a single place to call rdma_disconnect().

While there we better also disable all other [delayed_]work.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smbdirect.c