From f3c75bb2014e9ae7d212e0c016a94c529ac8a912 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 17 Jan 2018 15:15:43 +0100 Subject: [PATCH] activation: move check later Check for lv when it's known in all cases. --- lib/activate/activate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index b23400add..18cc7cfbe 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -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));