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

raid: setup LV size earlier

New validation code which does require to not store LV with no size
(no segments) revealed this size setup code needs to happen
earlier.
This commit is contained in:
Zdenek Kabelac 2017-10-30 17:23:56 +01:00
parent 3efd1f9c6e
commit 2b6391538c

View File

@ -4028,6 +4028,15 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
fa += stripes;
}
seg->len += extents;
if (seg_is_raid(seg))
seg->area_len = seg->len;
else
seg->area_len += extents / area_multiple;
if (!_setup_lv_size(lv, lv->le_count + extents))
return_0;
if (clear_metadata) {
/*
* We must clear the metadata areas upon creation.
@ -4092,15 +4101,6 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
lv_set_hidden(seg_metalv(seg, s));
}
seg->len += extents;
if (seg_is_raid(seg))
seg->area_len = seg->len;
else
seg->area_len += extents / area_multiple;
if (!_setup_lv_size(lv, lv->le_count + extents))
return_0;
return 1;
}