summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-06-24 00:36:08 +0200
committerMike Snitzer <snitzer@redhat.com>2016-07-18 15:37:24 -0400
commitfbe6365bb4732199a36e0fe6da89086936505e07 (patch)
treef6431ea22b3e379bbfb2ef50ace04a7910e367fa /drivers/md/dm-raid.c
parent2d92a3c2a45c7c40c84a4a59e3ce2bf6b34a4195 (diff)
downloadlinux-fbe6365bb4732199a36e0fe6da89086936505e07.tar.bz2
dm raid: fix raid10 device size error on out-of-place reshape
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 6dc494055267..8118f1e0218b 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -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)
{
struct mddev *mddev = &rs->md;
+ struct md_rdev *rdev;
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);
revalidate_disk(gendisk);
}