mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
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
This commit is contained in:
parent
f4b30b0dae
commit
05aceaffbd
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user