cifs: use mod_delayed_work() for &server->reconnect if already queued
authorStefan Metzmacher <metze@samba.org>
Mon, 24 Feb 2020 13:14:59 +0000 (14:14 +0100)
committerSteve French <stfrench@microsoft.com>
Mon, 23 Mar 2020 03:49:09 +0000 (22:49 -0500)
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>
fs/cifs/smb2pdu.c

index 8c23c10cafd21ae6cc46272cc807ad59e4f37f91..0f4cc8606cbc8b737e30c62effe812e6c4698e36 100644 (file)
@@ -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:
@@ -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;
        }