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

lv{resize,extend,reduce}: reject size change on 2-legged raid5*

Reject size changing request in to avoid 'Bus error' and
display hint to convert to more stripes.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1784351
This commit is contained in:
Heinz Mauelshagen 2020-06-24 13:52:53 +02:00
parent 3bd9d81b29
commit 2cf0f90780

View File

@ -5066,6 +5066,7 @@ static int _lvresize_check(struct logical_volume *lv,
struct lvresize_params *lp)
{
struct volume_group *vg = lv->vg;
struct lv_segment *seg = first_seg(lv);
if (lv_is_external_origin(lv)) {
/*
@ -5089,6 +5090,12 @@ static int _lvresize_check(struct logical_volume *lv,
return 0;
}
if (seg && seg_is_any_raid5(seg) && seg->area_count < 3) {
log_error("Cannot resize %s LV %s. Convert to more stripes first.",
lvseg_name(seg), display_lvname(lv));
return 0;
}
if (lv_is_raid(lv) &&
lp->resize == LV_REDUCE) {
unsigned attrs;