diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 11fb24701..376fee9d3 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -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); diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index e21e6cc10..ab0bfab3d 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -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); } diff --git a/tools/lvconvert.c b/tools/lvconvert.c index abec04a7e..0db10cbd9 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -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.",