From 13ba0f9492e93355754c97202b702eb69dbd0e5d Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 19 Sep 2006 19:13:41 +0000 Subject: [PATCH] Fix lvconvert mirror change case detection logic. Fix mirror log detachment so it correctly becomes a standalone LV. --- WHATS_NEW | 2 ++ lib/metadata/mirror.c | 4 +++- tools/lvconvert.c | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 49ea38b29..3d1f6b57c 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,7 @@ Version 2.02.10 - ================================== + Fix lvconvert mirror change case detection logic. + Fix mirror log detachment so it correctly becomes a standalone LV. Extend _check_contiguous() to detect single-area LVs. Include mirror log (untested) in _for_each_pv() processing. Use MIRROR_LOG_SIZE constant. diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 5b4c09ffa..498a2472b 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -161,9 +161,11 @@ int remove_mirror_images(struct lv_segment *mirrored_seg, uint32_t num_mirrors, remove_log = 1; } - if (remove_log) { + if (remove_log && mirrored_seg->log_lv) { log_lv = mirrored_seg->log_lv; mirrored_seg->log_lv = NULL; + log_lv->status &= ~MIRROR_LOG; + log_lv->status |= VISIBLE_LV; } /* diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 03f4673a6..a09fa77e5 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -344,8 +344,7 @@ static int lvconvert_mirrors(struct cmd_context * cmd, struct logical_volume * l lp->mirrors - 1); return 1; } - } - if (lp->mirrors > existing_mirrors) { + } else if (lp->mirrors > existing_mirrors) { /* FIXME Unless anywhere, remove PV of log_lv * from allocatable_pvs & allocate * (mirrors - existing_mirrors) new areas