]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ksmbd: Add missing set_freezable() for freezable kthread
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 21 Jan 2024 14:30:35 +0000 (23:30 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 07:54:27 +0000 (08:54 +0100)
From: Kevin Hao <haokexin@gmail.com>

[ Upstream commit 8fb7b723924cc9306bc161f45496497aec733904 ]

The kernel thread function ksmbd_conn_handler_loop() invokes
the try_to_freeze() in its loop. But all the kernel threads are
non-freezable by default. So if we want to make a kernel thread to be
freezable, we have to invoke set_freezable() explicitly.

Signed-off-by: Kevin Hao <haokexin@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/connection.c

index 3db9c06c946da5244f730ee035308c50ba50ad20..63815c4df1333ea98f948cd12bbfb26d8e2b4ba7 100644 (file)
@@ -284,6 +284,7 @@ int ksmbd_conn_handler_loop(void *p)
                goto out;
 
        conn->last_active = jiffies;
+       set_freezable();
        while (ksmbd_conn_alive(conn)) {
                if (try_to_freeze())
                        continue;