diff mbox series

ksmbd: Add missing set_freezable() for freezable kthread

Message ID 20231217134137.3111553-1-haokexin@gmail.com (mailing list archive)
State New, archived
Headers show
Series ksmbd: Add missing set_freezable() for freezable kthread | expand

Commit Message

Kevin Hao Dec. 17, 2023, 1:41 p.m. UTC
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>
---
 fs/smb/server/connection.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Namjae Jeon Jan. 10, 2024, 1:49 a.m. UTC | #1
2023-12-17 22:41 GMT+09:00, Kevin Hao <haokexin@gmail.com>:
> 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>
Sorry for late response. Applied it to #ksmbd-for-next-next.
Thanks for your patch!
diff mbox series

Patch

diff --git a/fs/smb/server/connection.c b/fs/smb/server/connection.c
index b6fa1e285c40..d311c2ee10bd 100644
--- a/fs/smb/server/connection.c
+++ b/fs/smb/server/connection.c
@@ -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;