From: Zdenek Kabelac Date: Thu, 16 May 2013 21:12:39 +0000 (+0200) Subject: lv_manip: use lv_is_active X-Git-Tag: v2_02_99~340 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=8cbacd2474b288a581274dba9b623ec2e9ac9d28;p=lvm2.git lv_manip: use lv_is_active Updated reverted commit. The usage of lv_is_active() is needed here, so the (!lv_is_active_exclusive_locally) gives the correct report. --- diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index fadef6b35..af000af9e 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4394,8 +4394,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l struct logical_volume *pool_lv; struct lv_list *lvl; const char *thin_name = NULL; - int origin_active = 0; - struct lvinfo info; if (new_lv_name && find_lv_in_vg(vg, new_lv_name)) { log_error("Logical volume \"%s\" already exists in " @@ -4525,15 +4523,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l log_warn("WARNING: See global/mirror_segtype_default in lvm.conf."); } - if (!lv_info(cmd, org, 0, &info, 0, 0)) { - log_error("Check for existence of active snapshot " - "origin '%s' failed.", org->name); - return NULL; - } - - origin_active = info.exists; - - if (vg_is_clustered(vg) && + if (vg_is_clustered(vg) && lv_is_active(org) && !lv_is_active_exclusive_locally(org)) { log_error("%s must be active exclusively to" " create snapshot", org->name);