mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
lvconvert: fix failing valid regionsize change
Reshape check failed when regionsize changed and current raid type was provided with no other change requested (stripes or stripesize). E.g. "lvconvert --type raid6 --regionsize 256K" on a raid6 LV with != 256K regionsize. Enable --type in test script.
This commit is contained in:
parent
01b5820d03
commit
532388fad5
@ -2389,7 +2389,7 @@ static int _reshape_requested(const struct logical_volume *lv, const struct segm
|
|||||||
if (seg_is_any_raid10(seg) && seg->area_count > 2 &&
|
if (seg_is_any_raid10(seg) && seg->area_count > 2 &&
|
||||||
stripes && stripes < seg->area_count - seg->segtype->parity_devs) {
|
stripes && stripes < seg->area_count - seg->segtype->parity_devs) {
|
||||||
log_error("Can't remove stripes from raid10");
|
log_error("Can't remove stripes from raid10");
|
||||||
goto err;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data_copies != seg->data_copies) {
|
if (data_copies != seg->data_copies) {
|
||||||
@ -2400,22 +2400,20 @@ static int _reshape_requested(const struct logical_volume *lv, const struct segm
|
|||||||
/* Change layout (e.g. raid5_ls -> raid5_ra) keeping # of stripes */
|
/* Change layout (e.g. raid5_ls -> raid5_ra) keeping # of stripes */
|
||||||
if (seg->segtype != segtype) {
|
if (seg->segtype != segtype) {
|
||||||
if (stripes && stripes != _data_rimages_count(seg, seg->area_count))
|
if (stripes && stripes != _data_rimages_count(seg, seg->area_count))
|
||||||
goto err;
|
return 2;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stripes && stripes == _data_rimages_count(seg, seg->area_count) &&
|
if (stripes && stripes == _data_rimages_count(seg, seg->area_count) &&
|
||||||
stripe_size == seg->stripe_size) {
|
stripe_size == seg->stripe_size &&
|
||||||
|
region_size == seg->region_size) {
|
||||||
log_error("LV %s already has %u stripes.",
|
log_error("LV %s already has %u stripes.",
|
||||||
display_lvname(lv), stripes);
|
display_lvname(lv), stripes);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (stripes || stripe_size) ? 1 : 0;
|
return (stripes || stripe_size) ? 1 : 0;
|
||||||
|
|
||||||
err:
|
|
||||||
return 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -27,7 +27,7 @@ function _test_regionsize
|
|||||||
local vg=$4
|
local vg=$4
|
||||||
local lv=$5
|
local lv=$5
|
||||||
|
|
||||||
lvconvert --yes -R $regionsize $vg/$lv
|
lvconvert --type $type --yes -R $regionsize $vg/$lv
|
||||||
[ $? -ne 0 ] && return 1
|
[ $? -ne 0 ] && return 1
|
||||||
check lv_field $vg/$lv regionsize "$regionsize_str"
|
check lv_field $vg/$lv regionsize "$regionsize_str"
|
||||||
fsck -fn "$DM_DEV_DIR/$vg/$lv"
|
fsck -fn "$DM_DEV_DIR/$vg/$lv"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user