dm: Fix deadlock when reloading a multipath table
authorBenjamin Marzinski <bmarzins@redhat.com>
Thu, 9 Oct 2025 03:04:31 +0000 (23:04 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 20 Oct 2025 13:26:57 +0000 (15:26 +0200)
commitbe4addb1914f00c60599495acacf4e24e9cb8237
treebc641def0080d197346f372f6e8dc1c9b44a7d7b
parent4929ba5c5bd75dc28971f0909902e4624e92ad59
dm: Fix deadlock when reloading a multipath table

Request-based devices (dm-multipath) queue I/O in blk-mq on noflush
suspends. Any queued IO will make it impossible to freeze the queue. If
a process attempts to update the queue limits while there is queued IO,
it can be get stuck holding the limits lock, while unable to freeze the
queue. If device-mapper then attempts to update the limits during a
table swap, it will deadlock trying to grab the limits lock while making
it impossible to flush the IO.

Disallow updating the queue limits during a table swap, when updating an
immutable request-based dm device (dm-multipath) during a noflush
suspend. It is userspace's responsibility to make sure that the new
table uses the same limits as the existing table if it asks for a
noflush suspend.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-table.c
drivers/md/dm-thin.c
drivers/md/dm.c