Files
linux/drivers/md
Heinz Mauelshagen cefcb9297f md raid: fix hang when stopping arrays with metadata through dm-raid
When using device-mapper's dm-raid target, stopping a RAID array can cause
the system to hang under specific conditions.

This occurs when:

- A dm-raid managed device tree is suspended from top to bottom
   (the top-level RAID device is suspended first, followed by its
    underlying metadata and data devices)

- The top-level RAID device is then removed

Removing the top-level device triggers a hang in the following sequence:
the dm-raid destructor calls md_stop(), which tries to flush the
write-intent bitmap by writing to the metadata sub-devices. However, these
devices are already suspended, making them unable to complete the write-intent
operations and causing an indefinite block.

Fix:

- Prevent bitmap flushing when md_stop() is called from dm-raid
destructor context
  and avoid a quiescing/unquescing cycle which could also cause I/O

- Still allow write-intent bitmap flushing when called from dm-raid
suspend context

This ensures that RAID array teardown can complete successfully even when the
underlying devices are in a suspended state.

This second patch uses md_is_rdwr() to distinguish between suspend and
destructor paths as elaborated on above.

Link: https://lore.kernel.org/linux-raid/CAM23VxqYrwkhKEBeQrZeZwQudbiNey2_8B_SEOLqug=pXxaFrA@mail.gmail.com
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
2026-01-26 13:46:40 +08:00
..
2024-04-01 11:53:37 -06:00
2025-08-19 11:12:50 +02:00
2023-02-14 14:23:07 -05:00
2024-02-20 14:22:51 -05:00
2025-12-10 19:28:22 +01:00
2023-02-14 14:23:06 -05:00
2024-11-20 11:38:04 +01:00
2025-11-05 08:07:21 -07:00
2025-01-13 07:36:29 -08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00