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: 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>

authored by Stefan Metzmacher and committed by Steve French bac28f60 93ed9a29

+3 -3
+3 -3
fs/smb/client/smbdirect.c
··· 1353 1353 sc->ib.qp = NULL; 1354 1354 1355 1355 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); 1357 1357 1358 1358 /* It's not possible for upper layer to get to reassembly */ 1359 1359 log_rdma_event(INFO, "drain the reassembly queue\n"); ··· 1726 1726 return NULL; 1727 1727 1728 1728 negotiation_failed: 1729 - cancel_delayed_work_sync(&info->idle_timer_work); 1729 + disable_delayed_work_sync(&info->idle_timer_work); 1730 1730 destroy_caches_and_workqueue(info); 1731 1731 sc->status = SMBDIRECT_SOCKET_NEGOTIATE_FAILED; 1732 1732 rdma_disconnect(sc->rdma.cm_id); ··· 2085 2085 struct smbdirect_socket *sc = &info->socket; 2086 2086 struct smbd_mr *mr, *tmp; 2087 2087 2088 - cancel_work_sync(&info->mr_recovery_work); 2088 + disable_work_sync(&info->mr_recovery_work); 2089 2089 list_for_each_entry_safe(mr, tmp, &info->mr_list, list) { 2090 2090 if (mr->state == MR_INVALIDATED) 2091 2091 ib_dma_unmap_sg(sc->ib.dev, mr->sgt.sgl,