Skip to content

Commit

Permalink
ksmbd: Add missing set_freezable() for freezable kthread
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Namjae Jeon <[email protected]>
  • Loading branch information
haokexin authored and namjaejeon committed Jan 10, 2024
1 parent 4c6bb4f commit ad311e5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,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;
Expand Down

0 comments on commit ad311e5

Please sign in to comment.