Skip to content

dm-delay: fix hung task issue

Joel Colledge dm-devel lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest1 patch 1 replyIn review
  2. v11 patch 6 repliesSuperseded

Changes in v2 from the cover letter

- Use kthread_run() instead of wake_up_process()

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1dm-delay: fix hung task introduced by kthread modedrivers/md/dm-delay.c+1 -21 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchBenjamin Marzinski
1/1R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/1] dm-delay: fix hung task issue

Hi,

The tests for DRBD encountered an issue with dm-delay when testing with a 6.8 series kernel. Specifically on Ubuntu 24.04 "Noble". Here is a minimal reproducer:

virter vm run --name dm-delay-test --id 10 --wait-ssh ubuntu-noble virter vm ssh dm-delay-test

# truncate -s 100M /file
# loop_dev=$(losetup -f --show /file)
# echo "0 $(blockdev --getsz $loop_dev) delay $loop_dev 0 0" | dmsetup create delay-volume

After a few minutes, the following is printed to the kernel log:

[  246.919123] INFO: task dm-delay-flush-:1256 blocked for more than 122 seconds.
[  246.922543]       Not tainted 6.8.0-31-generic #31-Ubuntu
[  246.923753] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  246.924932] task:dm-delay-flush- state:D stack:0     pid:1256  tgid:1256  ppid:2      flags:0x00004000
[  246.924940] Call Trace:
[  246.924950]  <TASK>
[  246.924980]  __schedule+0x27c/0x6b0
[  246.925002]  ? __pfx_flush_worker_fn+0x10/0x10 [dm_delay]
[  246.925011]  schedule+0x33/0x110
[  246.925016]  schedule_preempt_disabled+0x15/0x30
[  246.925035]  kthread+0xb1/0x120

...

This bug appears to have been introduced in Linux v6.7.

The following patch fixes the issue.

Thanks Christian and Benjamin for the comments on v1!

Changes from v1:
- Use kthread_run() instead of wake_up_process()

Joel Colledge (1):
dm-delay: fix hung task introduced by kthread mode

 drivers/md/dm-delay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Signature · 1 line
2.34.1