Skip to contentSkip to conversation

dm-log-writes: Add missing set_freezable() for log_writes_kthread()

PATCH New Kevin Hao 1 participant 1 message Dec 21, 2023 Device mapper

lore
Share & tools
lore

Kevin Hao

author
#0 lore raw

PATCH 1/1 dm-log-writes: Add missing set_freezable() for log_writes_kthread()

The kernel thread function log_writes_kthread() 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.

---
 drivers/md/dm-log-writes.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-log-writes.c +1 -0
index f17a6cf2284e..dabfc856443a 100644
@@ -432,6 +432,7 @@ static int log_writes_kthread(void *arg)
 	struct log_writes_c *lc = arg;
 	sector_t sector = 0;
 
+	set_freezable();
 	while (!kthread_should_stop()) {
 		bool super = false;
 		bool logging_enabled;
Signature · 1 line
2.39.2