Commit 9eb7109
dm: don't change md if dm_table_set_restrictions() fails
__bind was changing the disk capacity, geometry and mempools of the
mapped device before calling dm_table_set_restrictions() which could
fail, forcing dm to drop the new table. Failing here would leave the
device using the old table but with the wrong capacity and mempools.
Move dm_table_set_restrictions() earlier in __bind(). Since it needs the
capacity to be set, save the old version and restore it on failure.
Fixes: bb37d77 ("dm: introduce zone append emulation")
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>1 parent 0af2f6b commit 9eb7109
1 file changed
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2421 | 2421 | | |
2422 | 2422 | | |
2423 | 2423 | | |
2424 | | - | |
| 2424 | + | |
2425 | 2425 | | |
2426 | 2426 | | |
2427 | 2427 | | |
2428 | 2428 | | |
2429 | 2429 | | |
2430 | 2430 | | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
2431 | 2441 | | |
2432 | 2442 | | |
2433 | 2443 | | |
2434 | | - | |
| 2444 | + | |
2435 | 2445 | | |
2436 | 2446 | | |
2437 | | - | |
2438 | | - | |
2439 | 2447 | | |
2440 | 2448 | | |
2441 | 2449 | | |
| |||
2468 | 2476 | | |
2469 | 2477 | | |
2470 | 2478 | | |
2471 | | - | |
2472 | | - | |
2473 | | - | |
2474 | | - | |
2475 | | - | |
2476 | | - | |
2477 | 2479 | | |
2478 | 2480 | | |
2479 | 2481 | | |
| |||
0 commit comments