]> sourceware.org Git - lvm2.git/commitdiff
lv_manip: use lv_is_active
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 16 May 2013 21:12:39 +0000 (23:12 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 20 May 2013 14:47:33 +0000 (16:47 +0200)
Updated reverted commit.
The usage of lv_is_active() is needed here, so the
(!lv_is_active_exclusive_locally) gives the correct
report.

lib/metadata/lv_manip.c

index fadef6b35ac7ce3865ea4f3642a5ec63822f2d66..af000af9e16c2e98c902d7685f609ec2793620be 100644 (file)
@@ -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);
This page took 0.045327 seconds and 5 git commands to generate.