mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvconvert: ensure upconversion restrictions
Ensure minimum number of 3 data stripes on conversions to raid6. Add test for it. Resolves: rhbz1432675
This commit is contained in:
parent
76b843a4bf
commit
b0336e8b3c
@ -5087,6 +5087,19 @@ static int _takeover_upconvert_wrapper(TAKEOVER_FN_ARGS)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (segtype_is_any_raid6(new_segtype)) {
|
||||
uint32_t min_areas = 3;
|
||||
|
||||
if (seg_is_raid4(seg) || seg_is_any_raid5(seg))
|
||||
min_areas = 4;
|
||||
|
||||
if (seg->area_count < min_areas) {
|
||||
log_error("Minimum of %" PRIu32 " stripes needed for conversion from %s to %s.",
|
||||
min_areas, lvseg_name(seg), new_segtype->name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (seg_is_any_raid5(seg) && segtype_is_any_raid6(new_segtype) && seg->area_count < 4) {
|
||||
log_error("Minimum of 3 stripes needed for conversion from %s to %s.",
|
||||
lvseg_name(seg), new_segtype->name);
|
||||
|
@ -88,7 +88,16 @@ function _invalid_raid5_conversions
|
||||
not _lvconvert raid6 raid6_n_6 4 6 $vg $lv1
|
||||
}
|
||||
|
||||
# Delayst leg so that rebuilding status characters
|
||||
# Check raid6 conversion constrainst of minimum 3 stripes
|
||||
_lvcreate striped 2 2 4m $vg $lv1
|
||||
not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
_lvcreate raid0 3 3 4m $vg $lv1
|
||||
_lvconvert raid6 raid6_n_6 3 5 $vg $lv1
|
||||
lvremove -y $vg
|
||||
|
||||
# Delay 1st leg so that rebuilding status characters
|
||||
# can be read before resync finished too quick.
|
||||
# aux delay_dev "$dev1" 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user