Skip to content

Commit d14646f

Browse files
JoelColledgeMike Snitzer
authored andcommitted
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: 70bbeb2 ("dm delay: for short delays, use kthread instead of timers and wq") Signed-off-by: Joel Colledge <joel.colledge@linbit.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
1 parent 8d24790 commit d14646f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/md/dm-delay.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)
269269
* In case of small requested delays, use kthread instead of
270270
* timers and workqueue to achieve better latency.
271271
*/
272-
dc->worker = kthread_create(&flush_worker_fn, dc,
273-
"dm-delay-flush-worker");
272+
dc->worker = kthread_run(&flush_worker_fn, dc, "dm-delay-flush-worker");
274273
if (IS_ERR(dc->worker)) {
275274
ret = PTR_ERR(dc->worker);
276275
dc->worker = NULL;

0 commit comments

Comments
 (0)