dm log-writes: Add missing set_freezable() for freezable kthread

[ Upstream commit ab08f9c8b363297cafaf45475b08f78bf19b88ef ]

The log_writes_kthread() calls try_to_freeze() but lacks set_freezable(),
rendering the freeze attempt ineffective since kernel threads are
non-freezable by default. This prevents proper thread suspension during
system suspend/hibernate.

Add set_freezable() to explicitly mark the thread as freezable.

Fixes: 0e9cebe724 ("dm: add log writes target")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
This commit is contained in:
Haotian Zhang
2025-12-01 15:41:03 +08:00
committed by Ulrich Hecht
parent 4b569174bd
commit 29948a191d

View File

@ -454,6 +454,7 @@ static int log_writes_kthread(void *arg)
struct log_writes_c *lc = (struct log_writes_c *)arg;
sector_t sector = 0;
set_freezable();
while (!kthread_should_stop()) {
bool super = false;
bool logging_enabled;