summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-06-16 14:39:26 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-06-23 14:57:09 +0200
commitd30c2cec880e22ac2ce6cb6a1ee09584f2dc6aae (patch)
tree59ca748072bb9ec53a75bf30d4c893fa2cb745dd
parentf45b68940667563e1a8d3bbd5d30864c04381bdf (diff)
downloadlvm2-d30c2cec880e22ac2ce6cb6a1ee09584f2dc6aae.tar.gz
lvresize: check pvh list is vg->pvs
Instead of checking lp->argc for arg count, compare directly whether passed pvh is vg->pvs.
-rw-r--r--lib/metadata/lv_manip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 562047c74..f4abc4fdd 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4785,7 +4785,7 @@ static int _lvresize_extents_from_percent(struct logical_volume *lv, struct lvre
(lp->sign != SIGN_MINUS));
break;
case PERCENT_PVS:
- if (lp->argc) {
+ if (pvh != &vg->pvs) {
pv_extent_count = pv_list_extents_free(pvh);
lp->extents = percent_of_extents(lp->extents, pv_extent_count,
(lp->sign != SIGN_MINUS));
@@ -5228,7 +5228,7 @@ static struct logical_volume *_lvresize_volume(struct cmd_context *cmd,
}
alloc = lp->alloc ? : lv->alloc;
- if ((lp->resize == LV_REDUCE) && lp->argc)
+ if ((lp->resize == LV_REDUCE) && (pvh != &vg->pvs))
log_print_unless_silent("Ignoring PVs on command line when reducing.");
/* Request confirmation before operations that are often mistakes. */