]> sourceware.org Git - lvm2.git/commitdiff
activation: move check later
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Jan 2018 14:15:43 +0000 (15:15 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 17 Jan 2018 14:15:43 +0000 (15:15 +0100)
Check for lv when it's known in all cases.

lib/activate/activate.c

index b23400addca0b7c6eb70ce1a4911bb096e607d81..18cc7cfbefb91491355d4187b1ff816e85a3f93d 100644 (file)
@@ -2568,6 +2568,12 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
        struct lvinfo info;
        int r = 0;
 
+       if (!activation())
+               return 1;
+
+       if (!lv && !(lv_to_free = lv = lv_from_lvid(cmd, lvid_s, 0)))
+               goto out;
+
        if (!laopts->exclusive &&
            (lv_is_origin(lv) ||
             lv_is_pvmove(lv) ||
@@ -2578,12 +2584,6 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
                return 0;
        }
 
-       if (!activation())
-               return 1;
-
-       if (!lv && !(lv_to_free = lv = lv_from_lvid(cmd, lvid_s, 0)))
-               goto out;
-
        if (filter && !_passes_activation_filter(cmd, lv)) {
                log_verbose("Not activating %s since it does not pass "
                            "activation filter.", display_lvname(lv));
This page took 0.039128 seconds and 5 git commands to generate.