]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: smbdirect: set SMBDIRECT_KEEPALIVE_NONE before disable_delayed_work(&sc->idle...
authorStefan Metzmacher <metze@samba.org>
Thu, 28 Aug 2025 11:38:29 +0000 (13:38 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:18 +0000 (21:58 -0500)
This avoids a potential confusing log message from
smbdirect_connection_idle_timer_work() if it's already running.

This is a very small race windows and not really needed, but it feels
better when reading the code.

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
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/smbdirect/smbdirect_socket.c

index 34971c2700eecf4426c4a8a507f485ea1091da58..b5ce5f6443f601a477a81e17ab8d4f02e72af338 100644 (file)
@@ -106,6 +106,7 @@ static void __smbdirect_socket_schedule_cleanup(struct smbdirect_socket *sc,
        disable_work(&sc->recv_io.posted.refill_work);
        disable_work(&sc->mr_io.recovery_work);
        disable_work(&sc->idle.immediate_work);
+       sc->idle.keepalive = SMBDIRECT_KEEPALIVE_NONE;
        disable_delayed_work(&sc->idle.timer_work);
 
        switch (sc->status) {
@@ -191,6 +192,7 @@ static void smbdirect_socket_cleanup_work(struct work_struct *work)
        disable_work(&sc->recv_io.posted.refill_work);
        disable_work(&sc->mr_io.recovery_work);
        disable_work(&sc->idle.immediate_work);
+       sc->idle.keepalive = SMBDIRECT_KEEPALIVE_NONE;
        disable_delayed_work(&sc->idle.timer_work);
 
        switch (sc->status) {