diff options
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/metadata/mirror.c | 30 | ||||
-rw-r--r-- | tools/lvconvert.c | 2 |
3 files changed, 11 insertions, 22 deletions
@@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Split-mirror operations were ignoring user-specified PVs. Fix data corruption bug in cluster mirrors. Require logical volume(s) to be explicitly named for lvconvert --merge. Avoid changing aligned pe_start as a side-effect of very verbose logging. diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 67af56f6..36ee0ddd 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -524,34 +524,22 @@ static int _move_removable_mimages_to_end(struct logical_volume *lv, uint32_t count, struct dm_list *removable_pvs) { - int i, images; + int i; struct logical_volume *sub_lv; struct lv_segment *mirrored_seg = first_seg(lv); if (!removable_pvs) return 1; - /* - * When we shift an image to the end, we must start from - * the begining of the list again. We must visit the - * images up to the last one we just moved. - */ - for (images = mirrored_seg->area_count; images && count; images--) { - for (i = 0; i < images; i++) { - sub_lv = seg_lv(mirrored_seg, i); - - if (!is_temporary_mirror_layer(sub_lv) && - is_mirror_image_removable(sub_lv, removable_pvs)) { - if (!shift_mirror_images(mirrored_seg, i)) - return_0; - count--; - break; - } - } + for (i = mirrored_seg->area_count - 1; (i >= 0) && count; i--) { + sub_lv = seg_lv(mirrored_seg, i); - /* Did we shift any images? */ - if (i == images) - return 0; + if (!is_temporary_mirror_layer(sub_lv) && + is_mirror_image_removable(sub_lv, removable_pvs)) { + if (!shift_mirror_images(mirrored_seg, i)) + return_0; + count--; + } } return !count; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 1f17619e..1be3a8da 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1015,7 +1015,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd, lv->le_count, lp->region_size); - if (!operable_pvs && !lp->keep_mimages) + if (!operable_pvs) operable_pvs = lp->pvh; seg = first_seg(lv); |