From e56dd38021641061d5e773ce1f3bcdc1cfd25262 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 18 Sep 2008 19:09:47 +0000 Subject: [PATCH] Add missing LV error target activation in _remove_mirror_images. --- WHATS_NEW | 1 + lib/metadata/mirror.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 62eace74b..204acb1b2 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.40 - ================================ + Add missing LV error target activation in _remove_mirror_images. Prevent resizing an LV while lvconvert is using it. Avoid repeatedly wiping cache while VG_GLOBAL is held in vgscan & pvscan. Fix pvresize to not allow resize if PV has two metadata areas. diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index e1a77b160..5d9b355ca 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -552,6 +552,17 @@ static int _remove_mirror_images(struct logical_volume *lv, log_very_verbose("Updating \"%s\" in kernel", mirrored_seg->lv->name); + /* + * Avoid having same mirror target loaded twice simultaneouly by first + * activating the removed LV which now contains an error segment. + * As it's now detached from mirrored_seg->lv we must activate it + * explicitly. + */ + if (lv1 && !activate_lv(lv1->vg->cmd, lv1)) { + log_error("Problem reactivating removed %s", lv1->name); + return 0; + } + if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) { log_error("Problem reactivating %s", mirrored_seg->lv->name); return 0; -- 2.43.5