From d0191bf9f458b2977234091de9318e53372555a7 Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Mon, 16 Aug 2010 18:02:14 +0000 Subject: [PATCH] Fix for bug 612291: dm devices of split off mirror images are not removed DM devices were not handled properly on nodes in a cluster that were not where the splitmirrors command was issued. This was happening because suspend_lv/resume_lv were being used in a place where activate_lv should have been used. When the suspend/resume are issued on (effectively) new LVs, their 'resource' (UUID) is not located in the lv_hash. Thus, both operations turn into no-ops. You can see this from the output of clvmd from one of the remote nodes: do_suspend_lv, lock not already held do_resume_lv, lock not already held 'activate_lv' enjoins the other nodes in the cluster to process the lock and activate the new LV. clvmd output from remote node as follows: do_lock_lv: resource 'zMseY7CBuO3Ty09vXlplPAHzD0Y0CovjrTdv0R1VcwggMwPdYhutHErRcwm5Nd2S', cmd = 0x19 LCK_LV_ACTIVATE (READ|LV|NONBLOCK), flags = 0x84 (DMEVENTD_MONITOR ), memlock = 1 sync_lock: 'zMseY7CBuO3Ty09vXlplPAHzD0Y0CovjrTdv0R1VcwggMwPdYhutHErRcwm5Nd2S' mode:1 flags=1 sync_lock: returning lkid 27b0001 Signed-off-by: Jonathan Brassow Reviewed-by: Petr Rockai --- WHATS_NEW | 1 + lib/metadata/mirror.c | 13 +------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 205ce34a9..e518d1e2e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Fix 'lvconvert --splitmirrors' in cluster operation. Fix clvmd init script exit code when executed as non-root user. Change default alignment of pe_start to 1MB. Add --norestorefile option to pvcreate. diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index 36ee0ddd4..5fe14f9af 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -719,19 +719,8 @@ static int _split_mirror_images(struct logical_volume *lv, return 0; } - /* - * Suspend the newly split-off LV (balance memlock count - * and prepare for DM automated renaming via resume). - */ - if (!suspend_lv(lv->vg->cmd, new_lv)) { - log_error("Failed to lock newly split LV, %s", new_lv->name); - vg_revert(lv->vg); - return 0; - } - /* Bring newly split-off LV into existence */ - log_very_verbose("Creating %s", new_lv->name); - if (!resume_lv(lv->vg->cmd, new_lv)) { + if (!activate_lv(lv->vg->cmd, new_lv)) { log_error("Failed to activate newly split LV, %s", new_lv->name); return 0;