1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: allow regionsize on upconvert from linear

Allow to provide regionsize with "lvconvert -m1 -R N " on
upconverts from linear and on N -> M raid1 leg conversions.

Resolves: rhbz1394427
This commit is contained in:
Heinz Mauelshagen 2017-02-24 05:00:55 +01:00
parent 64a2fad5d6
commit 2574d3257a
3 changed files with 12 additions and 4 deletions

View File

@ -1213,6 +1213,7 @@ int lv_is_raid_with_tracking(const struct logical_volume *lv);
uint32_t lv_raid_image_count(const struct logical_volume *lv);
int lv_raid_change_image_count(struct logical_volume *lv,
uint32_t new_count,
uint32_t new_region_size,
struct dm_list *allocate_pvs);
int lv_raid_split(struct logical_volume *lv, const char *split_name,
uint32_t new_count, struct dm_list *splittable_pvs);

View File

@ -2866,11 +2866,11 @@ static int _raid_extract_images(struct logical_volume *lv,
display_lvname(lv),
display_lvname(seg_lv(seg, s)));
log_error("Try removing the PV list and rerun"
log_error("Try removing the PV list and rerun."
" the command.");
return 0;
}
log_debug("LVs with error segments to be removed: %s %s.",
log_debug("LVs with error segments to be removed: %s %s",
display_lvname(seg_metalv(seg, s)),
display_lvname(seg_lv(seg, s)));
} else {
@ -3013,8 +3013,15 @@ static int _lv_raid_change_image_count(struct logical_volume *lv, uint32_t new_c
}
int lv_raid_change_image_count(struct logical_volume *lv, uint32_t new_count,
struct dm_list *allocate_pvs)
const uint32_t new_region_size, struct dm_list *allocate_pvs)
{
struct lv_segment *seg = first_seg(lv);
if (new_region_size) {
seg->region_size = new_region_size;
_check_and_adjust_region_size(lv);
}
return _lv_raid_change_image_count(lv, new_count, allocate_pvs, NULL, 1, 0);
}

View File

@ -1359,7 +1359,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
DEFAULT_RAID1_MAX_IMAGES, lp->segtype->name, display_lvname(lv));
return 0;
}
if (!lv_raid_change_image_count(lv, image_count, /* lp->region_size, */ lp->pvh))
if (!lv_raid_change_image_count(lv, image_count, lp->region_size, lp->pvh))
return_0;
log_print_unless_silent("Logical volume %s successfully converted.",