Skip to content

Commit

Permalink
cifs: use mod_delayed_work() for &server->reconnect if already queued
Browse files Browse the repository at this point in the history
mod_delayed_work() is safer than queue_delayed_work() if there's a
chance that the work is already in the queue.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
metze-samba authored and Steve French committed Mar 23, 2020
1 parent e2e8751 commit b08484d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/cifs/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
}

if (smb2_command != SMB2_INTERNAL_CMD)
queue_delayed_work(cifsiod_wq, &server->reconnect, 0);
mod_delayed_work(cifsiod_wq, &server->reconnect, 0);

atomic_inc(&tconInfoReconnectCount);
out:
Expand Down Expand Up @@ -3570,7 +3570,7 @@ SMB2_echo(struct TCP_Server_Info *server)

if (server->tcpStatus == CifsNeedNegotiate) {
/* No need to send echo on newly established connections */
queue_delayed_work(cifsiod_wq, &server->reconnect, 0);
mod_delayed_work(cifsiod_wq, &server->reconnect, 0);
return rc;
}

Expand Down

0 comments on commit b08484d

Please sign in to comment.