Skip to content

Commit ac6fbc3

Browse files
metze-sambagregkh
authored andcommitted
smb: client: use disable[_delayed]_work_sync in smbdirect.c
[ Upstream commit bac28f6 ] 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 <[email protected]> Cc: Tom Talpey <[email protected]> Cc: Long Li <[email protected]> Cc: Namjae Jeon <[email protected]> Cc: [email protected] Cc: [email protected] 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 <[email protected]> Signed-off-by: Steve French <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a39e32f commit ac6fbc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/smb/client/smbdirect.c

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

13431343
log_rdma_event(INFO, "cancelling idle timer\n");
1344-
cancel_delayed_work_sync(&info->idle_timer_work);
1344+
disable_delayed_work_sync(&info->idle_timer_work);
13451345

13461346
/* It's not possible for upper layer to get to reassembly */
13471347
log_rdma_event(INFO, "drain the reassembly queue\n");
@@ -1713,7 +1713,7 @@ static struct smbd_connection *_smbd_get_connection(
17131713
return NULL;
17141714

17151715
negotiation_failed:
1716-
cancel_delayed_work_sync(&info->idle_timer_work);
1716+
disable_delayed_work_sync(&info->idle_timer_work);
17171717
destroy_caches_and_workqueue(info);
17181718
sc->status = SMBDIRECT_SOCKET_NEGOTIATE_FAILED;
17191719
rdma_disconnect(sc->rdma.cm_id);
@@ -2072,7 +2072,7 @@ static void destroy_mr_list(struct smbd_connection *info)
20722072
struct smbdirect_socket *sc = &info->socket;
20732073
struct smbd_mr *mr, *tmp;
20742074

2075-
cancel_work_sync(&info->mr_recovery_work);
2075+
disable_work_sync(&info->mr_recovery_work);
20762076
list_for_each_entry_safe(mr, tmp, &info->mr_list, list) {
20772077
if (mr->state == MR_INVALIDATED)
20782078
ib_dma_unmap_sg(sc->ib.dev, mr->sgt.sgl,

0 commit comments

Comments
 (0)