mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix reversal of LV list before performing a split mirror.
When splitting off mirror images from a mirror, we always take LVs from the end of a list. For example, if the mirror sub-devices are lv_mimage_[012], we should select lv_mimage_2 if splitting off one image. However, lv_mimage_0 was being selected instead. The problem came from calling '_move_removable_mimages_to_end' when it was unnecessary to do so. When the user /does/ specify specific devices to be removed, this function properly moved the appropriate LVs to the end of the list for extraction. However, if the user /doesn't/ give any specific PVs, the function should do nothing. '_move_removable_mimages_to_end' was keying off of whether 'removable_pvs' was NULL or not and this value was improperly being populated with the set of all available PVs. This was causing '_move_removable_mimages_to_end' to completely reverse the list, which in turn caused us to extract the hithertofore front-of-the-list LVs.
This commit is contained in:
parent
ceb0db233a
commit
48c245884e
@ -1002,7 +1002,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
|
||||
lv->le_count,
|
||||
lp->region_size);
|
||||
|
||||
if (!operable_pvs)
|
||||
if (!operable_pvs && !lp->keep_mimages)
|
||||
operable_pvs = lp->pvh;
|
||||
|
||||
seg = first_seg(lv);
|
||||
|
Loading…
Reference in New Issue
Block a user