diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2013-03-01 17:45:48 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2013-03-01 17:45:48 -0500 |
commit | 87eb5b21d92a92ac2da3163039d62df88c2b8422 (patch) | |
tree | ada6ec7e575e4b95a018ecbe023af135da2b639e /drivers/md | |
parent | 23cb21092eb9dcec9d3604b68d95192b79915890 (diff) |
dm: fix limits initialization when there are no data devices
dm_calculate_queue_limits will first reset the provided limits to
defaults using blk_set_stacking_limits; whereby defeating the purpose of
retaining the original live table's limits -- as was intended via commit
3ae706561637331aa578e52bb89ecbba5edcb7a9 ("dm: retain table limits when
swapping to new table with no devices").
Fix this improper limits initialization (in the no data devices case) by
avoiding the call to dm_calculate_queue_limits.
[patch header revised by Mike Snitzer]
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org # v3.6+
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 0890abd9dffa..1016c14c28a0 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -2446,7 +2446,7 @@ static void dm_queue_flush(struct mapped_device *md) | |||
2446 | */ | 2446 | */ |
2447 | struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table) | 2447 | struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table) |
2448 | { | 2448 | { |
2449 | struct dm_table *live_map, *map = ERR_PTR(-EINVAL); | 2449 | struct dm_table *live_map = NULL, *map = ERR_PTR(-EINVAL); |
2450 | struct queue_limits limits; | 2450 | struct queue_limits limits; |
2451 | int r; | 2451 | int r; |
2452 | 2452 | ||
@@ -2469,10 +2469,12 @@ struct dm_table *dm_swap_table(struct mapped_device *md, struct dm_table *table) | |||
2469 | dm_table_put(live_map); | 2469 | dm_table_put(live_map); |
2470 | } | 2470 | } |
2471 | 2471 | ||
2472 | r = dm_calculate_queue_limits(table, &limits); | 2472 | if (!live_map) { |
2473 | if (r) { | 2473 | r = dm_calculate_queue_limits(table, &limits); |
2474 | map = ERR_PTR(r); | 2474 | if (r) { |
2475 | goto out; | 2475 | map = ERR_PTR(r); |
2476 | goto out; | ||
2477 | } | ||
2476 | } | 2478 | } |
2477 | 2479 | ||
2478 | map = __bind(md, table, &limits); | 2480 | map = __bind(md, table, &limits); |