If the worker thread is not woken due to a bio, then it is not woken at
all. This causes the hung task check to trigger. For instance, when a
delay of 0 is configured, delay_bio() returns without waking the worker,
so this situation occurs.

Prevent the hung task check from triggering by waking up the newly
minted worker in delay_ctr().

Fixes: 70bbeb29fab0 ("dm delay: for short delays, use kthread instead of timers 
and wq")
Signed-off-by: Joel Colledge <[email protected]>
---
 drivers/md/dm-delay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c
index 5eabdb06c649..003512bb5fea 100644
--- a/drivers/md/dm-delay.c
+++ b/drivers/md/dm-delay.c
@@ -274,6 +274,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int 
argc, char **argv)
                        dc->worker = NULL;
                        goto bad;
                }
+               wake_up_process(dc->worker);
        } else {
                timer_setup(&dc->delay_timer, handle_delayed_timer, 0);
                INIT_WORK(&dc->flush_expired_bios, flush_expired_bios);
-- 
2.34.1


Reply via email to