Commit d14646f2 authored by Joel Colledge's avatar Joel Colledge Committed by Mike Snitzer

dm-delay: fix hung task introduced by kthread mode

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. This occurs, for
instance, when no bios are submitted. Also when a delay of 0 is
configured, delay_bio() returns without waking the worker.

Prevent the hung task check from triggering by creating the thread with
kthread_run() instead of using kthread_create() directly.

Fixes: 70bbeb29 ("dm delay: for short delays, use kthread instead of timers and wq")
Signed-off-by: default avatarJoel Colledge <joel.colledge@linbit.com>
Reviewed-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 8d24790e
......@@ -269,8 +269,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
* In case of small requested delays, use kthread instead of
* timers and workqueue to achieve better latency.
*/
dc->worker = kthread_create(&flush_worker_fn, dc,
"dm-delay-flush-worker");
dc->worker = kthread_run(&flush_worker_fn, dc, "dm-delay-flush-worker");
if (IS_ERR(dc->worker)) {
ret = PTR_ERR(dc->worker);
dc->worker = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment