From: Zdenek Kabelac Date: Sun, 7 Mar 2021 17:10:48 +0000 (+0100) Subject: cleanup: move code X-Git-Tag: v2_03_12~302 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=64447e9d9b237bf7955a84ab028a0d9b552e6ac7;p=lvm2.git cleanup: move code just evaluate later in code path. --- diff --git a/lib/activate/activate.c b/lib/activate/activate.c index a56227118..ddad7c3f7 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -2049,12 +2049,6 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, if (!activation()) return 1; - /* Ignore origin_only unless LV is origin in both old and new metadata */ - /* or LV is thin or thin pool volume */ - if (!lv_is_thin_volume(lv) && !lv_is_thin_pool(lv) && - !(lv_is_origin(lv) && lv_is_origin(lv_pre))) - laopts->origin_only = 0; - if (test_mode()) { _skip("Suspending %s%s.", display_lvname(lv), laopts->origin_only ? " origin without snapshots" : ""); @@ -2076,6 +2070,12 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, lv_calculate_readahead(lv, NULL); + /* Ignore origin_only unless LV is origin in both old and new metadata */ + /* or LV is thin or thin pool volume */ + if (!lv_is_thin_volume(lv) && !lv_is_thin_pool(lv) && + !(lv_is_origin(lv) && lv_is_origin(lv_pre))) + laopts->origin_only = 0; + /* * Preload devices for the LV. * If the PVMOVE LV is being removed, it's only present in the old