1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

raid: postpone archiving until metadata are changed

Avoid archiving of lvm2 metadata when there is call of 'lvconvert --repair'
on healthy raid LV.
This commit is contained in:
Zdenek Kabelac 2017-01-06 23:36:31 +01:00
parent 0d2a9ebec6
commit a4be2be5a4

View File

@ -3952,9 +3952,6 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
return 0;
}
if (!archive(lv->vg))
return_0;
/*
* How many sub-LVs are being removed?
*/
@ -3972,6 +3969,9 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
lv_is_on_pvs(seg_metalv(raid_seg, s), remove_pvs)) {
match_count++;
if (rebuild) {
if ((match_count == 1) &&
!archive(lv->vg))
return_0;
seg_lv(raid_seg, s)->status |= LV_REBUILD;
seg_metalv(raid_seg, s)->status |= LV_REBUILD;
}
@ -4017,6 +4017,9 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv,
if (rebuild)
goto skip_alloc;
if (!archive(lv->vg))
return_0;
/* Prevent any PVs holding image components from being used for allocation */
if (!_avoid_pvs_with_other_images_of_lv(lv, allocate_pvs)) {
log_error("Failed to prevent PVs holding image components "