From 13aba0817baa7bde9e1839d9c1a081b573d2532d Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 17 Sep 2007 17:18:37 +0000 Subject: [PATCH] Remove no-longer-correct restrictions on PV arg count with stripes/mirrors. [E.g. They fail if tags or --alloc anywhere used.] --- WHATS_NEW | 1 + tools/lvcreate.c | 19 ++----------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index aa5d7ab86..75c58318e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.29 - ================================== + Remove no-longer-correct restrictions on PV arg count with stripes/mirrors. Fix strdup memory leak in str_list_dup(). Link with -lpthread when static SELinux libraries require that. Detect command line PE values that exceed their 32-bit range. diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 8768cc5fb..bf9907225 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -180,10 +180,8 @@ static int _read_size_params(struct lvcreate_params *lp, * up to the power of 2) */ static int _read_stripe_params(struct lvcreate_params *lp, struct cmd_context *cmd, - int *pargc) + int *pargc __attribute((unused))) { - int argc = *pargc; - if (arg_count(cmd, stripesize_ARG)) { if (arg_sign_value(cmd, stripesize_ARG, 0) == SIGN_MINUS) { log_error("Negative stripesize is invalid"); @@ -211,12 +209,6 @@ static int _read_stripe_params(struct lvcreate_params *lp, display_size(cmd, (uint64_t) lp->stripe_size)); } - if (argc && (unsigned) argc < lp->stripes) { - log_error("Too few physical volumes on " - "command line for %d-way striping", lp->stripes); - return 0; - } - if (lp->stripes < 1 || lp->stripes > MAX_STRIPES) { log_error("Number of stripes (%d) must be between %d and %d", lp->stripes, 1, MAX_STRIPES); @@ -236,19 +228,12 @@ static int _read_stripe_params(struct lvcreate_params *lp, static int _read_mirror_params(struct lvcreate_params *lp, struct cmd_context *cmd, - int *pargc) + int *pargc __attribute((unused))) { - int argc = *pargc; int region_size; int pagesize = lvm_getpagesize(); const char *mirrorlog; - if (argc && (unsigned) argc < lp->mirrors) { - log_error("Too few physical volumes on " - "command line for %d-way mirroring", lp->mirrors); - return 0; - } - if (arg_count(cmd, regionsize_ARG)) { if (arg_sign_value(cmd, regionsize_ARG, 0) == SIGN_MINUS) { log_error("Negative regionsize is invalid");