Skip to contentSkip to conversation

ksmbd: Add missing set_freezable() for freezable kthread

PATCH In review Kevin Hao 2 participants 2 messages Dec 17, 2023 – Jan 10, 2024

Subsystems (2)
lore
Share & tools
lore

Kevin Hao

author
#0 lore raw

PATCH 1/1 ksmbd: Add missing set_freezable() for freezable kthread

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.

---
 fs/smb/server/connection.c | 1 +
 1 file changed, 1 insertion(+)
fs/smb/server/connection.c +1 -0
index b6fa1e285c40..d311c2ee10bd 100644
@@ -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;
Signature · 1 line
2.39.2
maintainer Acked-by on v1 1/1
#1 lore raw

2023-12-17 22:41 GMT+09:00, Kevin Hao <[email protected]>:

Quoted 6 lines

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.

Sorry for late response. Applied it to #ksmbd-for-next-next. Thanks for your patch!