From ed32476c67332eb38caa28ed041028e80440cbfd Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 28 Oct 2011 20:29:06 +0000 Subject: [PATCH] Thin works only with exclusive activation Enforce exclusive activation with thin targets. --- tools/lvchange.c | 4 +++- tools/vgchange.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/lvchange.c b/tools/lvchange.c index 09377ab18..c58a9e380 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -135,7 +135,9 @@ static int lvchange_availability(struct cmd_context *cmd, if (!deactivate_lv(cmd, lv)) return_0; } else { - if (lv_is_origin(lv) || (activate == CHANGE_AE)) { + if ((activate == CHANGE_AE) || + lv_is_origin(lv) || + lv_is_thin_type(lv)) { log_verbose("Activating logical volume \"%s\" " "exclusively", lv->name); if (!activate_lv_excl(cmd, lv)) diff --git a/tools/vgchange.c b/tools/vgchange.c index 8cb0e230f..39d58f146 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -149,10 +149,10 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, stack; continue; } - } else if (lv_is_origin(lv) || - lv_is_thin_pool(lv) || - lv_is_thin_volume(lv) || - (activate == CHANGE_AE)) { + } else if ((activate == CHANGE_AE) || + lv_is_origin(lv) || + lv_is_thin_type(lv)) { + /* FIXME: duplicated test code with lvchange */ if (!activate_lv_excl(cmd, lv)) { stack; continue; -- 2.43.5