Skip to content

Commit bac28f6

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: use disable[_delayed]_work_sync in smbdirect.c
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: 050b8c3 ("smbd: Make upper layer decide when to destroy the transport") Fixes: f198186 ("CIFS: SMBD: Establish SMB Direct connection") Fixes: c739858 ("CIFS: SMBD: Implement RDMA memory registration") Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 93ed9a2 commit bac28f6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/smb/client/smbdirect.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ void smbd_destroy(struct TCP_Server_Info *server)
13531353
sc->ib.qp = NULL;
13541354

13551355
log_rdma_event(INFO, "cancelling idle timer\n");
1356-
cancel_delayed_work_sync(&info->idle_timer_work);
1356+
disable_delayed_work_sync(&info->idle_timer_work);
13571357

13581358
/* It's not possible for upper layer to get to reassembly */
13591359
log_rdma_event(INFO, "drain the reassembly queue\n");
@@ -1726,7 +1726,7 @@ static struct smbd_connection *_smbd_get_connection(
17261726
return NULL;
17271727

17281728
negotiation_failed:
1729-
cancel_delayed_work_sync(&info->idle_timer_work);
1729+
disable_delayed_work_sync(&info->idle_timer_work);
17301730
destroy_caches_and_workqueue(info);
17311731
sc->status = SMBDIRECT_SOCKET_NEGOTIATE_FAILED;
17321732
rdma_disconnect(sc->rdma.cm_id);
@@ -2085,7 +2085,7 @@ static void destroy_mr_list(struct smbd_connection *info)
20852085
struct smbdirect_socket *sc = &info->socket;
20862086
struct smbd_mr *mr, *tmp;
20872087

2088-
cancel_work_sync(&info->mr_recovery_work);
2088+
disable_work_sync(&info->mr_recovery_work);
20892089
list_for_each_entry_safe(mr, tmp, &info->mr_list, list) {
20902090
if (mr->state == MR_INVALIDATED)
20912091
ib_dma_unmap_sg(sc->ib.dev, mr->sgt.sgl,

0 commit comments

Comments
 (0)