Merging process and patch rework missed some bits - fix them.
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,
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;
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,