]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm: handle failures in dm_table_set_restrictions
authorBenjamin Marzinski <bmarzins@redhat.com>
Thu, 10 Apr 2025 19:49:40 +0000 (15:49 -0400)
committerMikulas Patocka <mpatocka@redhat.com>
Fri, 11 Apr 2025 11:38:53 +0000 (13:38 +0200)
commit4ea30ec6fb3bb598bd1df04cdfab13b1140074d2
tree788c040a4d7246bca260456df7a37256b2b4be3f
parente8819e7f03470c5b468720630d9e4e1d5b99159e
dm: handle failures in dm_table_set_restrictions

If dm_table_set_restrictions() fails while swapping tables,
device-mapper will continue using the previous table. It must be sure to
leave the mapped_device in it's previous state on failure.  Otherwise
device-mapper could end up using the old table with settings from the
unused table.

Do not update the mapped device in dm_set_zones_restrictions(). Wait
till after dm_table_set_restrictions() is sure to succeed to update the
md zoned settings. Do the same with the dax settings, and if
dm_revalidate_zones() fails, restore the original queue limits.

Fixes: 7f91ccd8a608d ("dm: Call dm_revalidate_zones() after setting the queue limits")
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Tested-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-table.c
drivers/md/dm-zone.c
drivers/md/dm.h