Commit fbe6365b authored by Heinz Mauelshagen's avatar Heinz Mauelshagen Committed by Mike Snitzer
Browse files

dm raid: fix raid10 device size error on out-of-place reshape

Signed-off-by: default avatarHeinz Mauelshagen <>
Signed-off-by: default avatarMike Snitzer <>
parent 2d92a3c2
...@@ -622,8 +622,16 @@ static struct raid_type *get_raid_type_by_ll(const int level, const int layout) ...@@ -622,8 +622,16 @@ static struct raid_type *get_raid_type_by_ll(const int level, const int layout)
static void rs_set_capacity(struct raid_set *rs) static void rs_set_capacity(struct raid_set *rs)
{ {
struct mddev *mddev = &rs->md; struct mddev *mddev = &rs->md;
struct md_rdev *rdev;
struct gendisk *gendisk = dm_disk(dm_table_get_md(rs->ti->table)); struct gendisk *gendisk = dm_disk(dm_table_get_md(rs->ti->table));
* raid10 sets rdev->sector to the device size, which
* is unintended in case of out-of-place reshaping
rdev_for_each(rdev, mddev)
rdev->sectors = mddev->dev_sectors;
set_capacity(gendisk, mddev->array_sectors); set_capacity(gendisk, mddev->array_sectors);
revalidate_disk(gendisk); revalidate_disk(gendisk);
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment