summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2017-03-07 21:36:03 +0100
committerHeinz Mauelshagen <heinzm@redhat.com>2017-03-07 21:36:03 +0100
commit05aceaffbd184c6b5d892d92a6c4d9db182da8f8 (patch)
treee138ffb487216c791f4cfbb90c45a43d40042b98
parentf4b30b0daef3bac7f775dff29c21ac47fe5d82a7 (diff)
downloadlvm2-05aceaffbd184c6b5d892d92a6c4d9db182da8f8.tar.gz
lvconvert: adjust --stripes on raid10 convert
For the time being raid10 is limited to even number of total stripes as is and 2 data copies. The number of stripes provided on creation of a raid10(_near) LV with -i/--stripes gets doubled to define that even total number of stripes (i.e. images). Apply the same on disk adding conversions (reshapes) with "lvconvert --stripes RaidLV" (e.g. 2 stripes = 4 images total converted to 3 stripes = 6 images total). Related: rhbz834579 Related: rhbz1191935 Related: rhbz1191978
-rw-r--r--lib/metadata/raid_manip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 6cc1c12c3..1a4a86037 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -5878,7 +5878,7 @@ int lv_raid_convert(struct logical_volume *lv,
struct dm_list *allocate_pvs)
{
struct lv_segment *seg = first_seg(lv);
- uint32_t stripes, stripe_size;
+ uint32_t stripes = new_stripes, stripe_size;
uint32_t new_image_count = seg->area_count;
uint32_t region_size = new_region_size;
uint32_t data_copies = seg->data_copies;
@@ -5890,7 +5890,10 @@ int lv_raid_convert(struct logical_volume *lv,
return 0;
}
- stripes = new_stripes ? : _data_rimages_count(seg, seg->area_count);
+ if (seg_is_raid10(seg))
+ stripes *= 2;
+
+ stripes = stripes ? : _data_rimages_count(seg, seg->area_count);
/* FIXME Ensure caller does *not* set wrong default value! */
/* Define new stripe size if not passed in */