]> sourceware.org Git - lvm2.git/commitdiff
lvresize: fixes for recent commit
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 23 Jun 2016 22:24:26 +0000 (00:24 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 23 Jun 2016 22:39:14 +0000 (00:39 +0200)
Merging process and patch rework missed some bits - fix them.

lib/metadata/lv_manip.c
tools/lvresize.c

index 8f0726775f3014c1c7116dae5d6434a07abf5521..40c1c1a8f163e5d86be87e03b3af846c4586f792 100644 (file)
@@ -4452,7 +4452,7 @@ static uint32_t _adjust_amount(dm_percent_t percent, int policy_threshold, int p
        percent = (percent / policy_threshold + (DM_PERCENT_1 - 1) / 100) / (DM_PERCENT_1 / 100) - 100;
 
        /* Use it if current policy amount is smaller */
-       return (policy_amount < percent) ? (uint32_t) policy_amount : (uint32_t) percent;
+       return (policy_amount < percent) ? (uint32_t) percent : (uint32_t) policy_amount;
 }
 
 static int _lvresize_adjust_policy(const struct logical_volume *lv,
@@ -5241,7 +5241,10 @@ int lv_resize(struct logical_volume *lv,
                return_0;
 
        if (lp->use_policies) {
-               lp->percent = SIGN_PLUS;
+               lp->extents = 0;
+               lp->sign = SIGN_PLUS;
+               lp->percent = PERCENT_LV;
+
                aux_lp = *lp;
                if (!_lvresize_adjust_policy(lv, &lp->extents, &aux_lp.extents))
                        return_0;
index 45d35588337ad21b35c0b29a6d89e3b8621dde98..35b70446ff3365383b3e472a4b623959024fe35a 100644 (file)
@@ -34,11 +34,7 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
        lp->sign = lp->poolmetadata_sign = SIGN_NONE;
 
        if ((lp->use_policies = arg_is_set(cmd, usepolicies_ARG))) {
-               /* do nothing; _lvresize will handle --use-policies itself */
-               lp->extents = 0;
-               lp->sign = SIGN_PLUS;
-               lp->percent = PERCENT_LV;
-
+               /* do nothing; lv_resize will handle --use-policies itself */
                if (arg_from_list_is_set(cmd, NULL,
                                         chunksize_ARG, extents_ARG,
                                         poolmetadatasize_ARG,
This page took 0.05199 seconds and 5 git commands to generate.