diff options
author | Alasdair Kergon <agk@redhat.com> | 2008-01-17 13:13:54 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2008-01-17 13:13:54 +0000 |
commit | 5cf3c51857c397a1b298b0308635cfdf4dc8ad08 (patch) | |
tree | c75cc346c9d7407fe90094011bcb2399bb5f75c6 /tools/vgreduce.c | |
parent | f43c66368b7a261baf277ec8c925911c81e78fc7 (diff) | |
download | lvm2-5cf3c51857c397a1b298b0308635cfdf4dc8ad08.tar.gz lvm2-5cf3c51857c397a1b298b0308635cfdf4dc8ad08.tar.xz lvm2-5cf3c51857c397a1b298b0308635cfdf4dc8ad08.zip |
lvconvert/vgreduce fixes
Diffstat (limited to 'tools/vgreduce.c')
-rw-r--r-- | tools/vgreduce.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/vgreduce.c b/tools/vgreduce.c index 62f12acd..caf93b68 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -255,8 +255,10 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) } } + lvs_changed_altered: /* Remove lost mirror images from mirrors */ list_iterate_items(lvl, &vg->lvs) { + mirrored_seg_altered: mirrored_seg = first_seg(lvl->lv); if (!seg_is_mirrored(mirrored_seg)) continue; @@ -315,6 +317,23 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) vg_revert(vg); return 0; } + + /* mirrored LV no longer has valid mimages. + * So add it to lvs_changed for removal. + * For this LV may be an area of other mirror, + * restart the loop. */ + if (!mimages) { + if (!_remove_lv(cmd, lvl->lv, + &list_unsafe, &lvs_changed)) + return_0; + goto lvs_changed_altered; + } + + /* As a result of reconfigure_mirror_images(), + * first_seg(lv) may now be different seg. + * e.g. a temporary layer might be removed. + * So check the mirrored_seg again. */ + goto mirrored_seg_altered; } } |