summaryrefslogtreecommitdiff
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-06-24 01:03:19 +0200
committerMike Snitzer <snitzer@redhat.com>2016-07-18 15:37:25 -0400
commit2527b56e0d2f6c4f4a2a20a0ae773d96ba69d3fe (patch)
tree35c97b0a164f4107b4e8cf862fb885d6637c982d /drivers/md/dm-raid.c
parentfbe6365bb4732199a36e0fe6da89086936505e07 (diff)
dm raid: add comments and fix typos
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.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 8118f1e0218b..457220217a93 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -1618,7 +1618,6 @@ static int rs_check_takeover(struct raid_set *rs)
/* raid1 -> raid10 */
if (mddev->new_level == 10)
return 0;
-
break;
case 4:
@@ -2424,8 +2423,8 @@ static int rs_adjust_data_offsets(struct raid_set *rs)
* data is at offset rs->data_offset != 0 and
* free space is at begin of each component LV
*
- * - after reshape: data is at offset 0 if i was at offset != 0
- * of at offset != 0 if it was at offset 0
+ * - after reshape: data is at offset 0 if it was at offset != 0
+ * or at offset != 0 if it was at offset 0
* on each component LV
*
*/
@@ -2731,6 +2730,12 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
rs->md.sync_super = super_sync;
+ /*
+ * Calculate ctr requested array and device sizes to allow
+ * for superblock analysis needing device sizes defined.
+ *
+ * Any existing superblock will overwrite the array and device sizes
+ */
r = rs_set_dev_and_array_sectors(rs, false);
if (r)
return r;
@@ -2781,8 +2786,9 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
}
/*
- * If a takeover is needed, just set the level to
- * the new requested one and allow the raid set to run.
+ * If a takeover is needed, userspace sets any additional
+ * devices to rebuild, so just set the level to the new
+ * requested one and allow the raid set to run
*/
r = rs_check_takeover(rs);
if (r)
@@ -2845,7 +2851,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
}
if (rs->md.raid_disks < rs->raid_disks)
- set_bit(MD_ARRAY_FIRST_USE, &rs->md.flags);
+ set_bit(MD_ARRAY_FIRST_USE, &mddev->flags);
rs_set_cur(rs);
rs_setup_recovery(rs, MaxSector);
@@ -2935,7 +2941,7 @@ static int raid_map(struct dm_target *ti, struct bio *bio)
* mddev->array_sectors will differ during the process
* (ti->len > mddev->array_sectors), so we have to requeue
* bios with addresses > mddev->array_sectors here or
- * or there will occur accesses past EOD of the component
+ * there will occur accesses past EOD of the component
* data images thus erroring the raid set.
*/
if (unlikely(bio_end_sector(bio) > mddev->array_sectors))