]> www.infradead.org Git - users/hch/misc.git/commitdiff
smb: client: use disable[_delayed]_work_sync in smbdirect.c
authorStefan Metzmacher <metze@samba.org>
Tue, 12 Aug 2025 10:58:21 +0000 (12:58 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 18 Sep 2025 01:33:44 +0000 (20:33 -0500)
This makes it safer during the disconnect and avoids
requeueing.

It's ok to call disable[delayed_]work[_sync]() more than once.

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
Fixes: 050b8c374019 ("smbd: Make upper layer decide when to destroy the transport")
Fixes: f198186aa9bb ("CIFS: SMBD: Establish SMB Direct connection")
Fixes: c7398583340a ("CIFS: SMBD: Implement RDMA memory registration")
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smbdirect.c

index dafa3ed4a630f967871f334a339eb5d869403ff3..1f8de8866c060553a98f98475344d10b86268309 100644 (file)
@@ -1353,7 +1353,7 @@ void smbd_destroy(struct TCP_Server_Info *server)
        sc->ib.qp = NULL;
 
        log_rdma_event(INFO, "cancelling idle timer\n");
-       cancel_delayed_work_sync(&info->idle_timer_work);
+       disable_delayed_work_sync(&info->idle_timer_work);
 
        /* It's not possible for upper layer to get to reassembly */
        log_rdma_event(INFO, "drain the reassembly queue\n");
@@ -1726,7 +1726,7 @@ allocate_mr_failed:
        return NULL;
 
 negotiation_failed:
-       cancel_delayed_work_sync(&info->idle_timer_work);
+       disable_delayed_work_sync(&info->idle_timer_work);
        destroy_caches_and_workqueue(info);
        sc->status = SMBDIRECT_SOCKET_NEGOTIATE_FAILED;
        rdma_disconnect(sc->rdma.cm_id);
@@ -2085,7 +2085,7 @@ static void destroy_mr_list(struct smbd_connection *info)
        struct smbdirect_socket *sc = &info->socket;
        struct smbd_mr *mr, *tmp;
 
-       cancel_work_sync(&info->mr_recovery_work);
+       disable_work_sync(&info->mr_recovery_work);
        list_for_each_entry_safe(mr, tmp, &info->mr_list, list) {
                if (mr->state == MR_INVALIDATED)
                        ib_dma_unmap_sg(sc->ib.dev, mr->sgt.sgl,