1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvresize: fix regressiong on accepting args

Commit f45b689406 caused regression
of lvresize -m and --type  parameter

After fix this sequence may work when we also fix syntax description:

lvcreate -l1 -m1 -n lv1 vg
lvextend --type mirror -m1 -l+1 vg/lv1
This commit is contained in:
Zdenek Kabelac 2017-02-19 19:08:48 +01:00
parent 13944738d4
commit 87c89ac279

View File

@ -21,7 +21,7 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
const char *cmd_name = command_name(cmd);
const char *type_str = arg_str_value(cmd, type_ARG, NULL);
if (type_str && (lp->segtype = get_segtype_from_string(cmd, type_str)))
if (type_str && !(lp->segtype = get_segtype_from_string(cmd, type_str)))
return_0;
if (!strcmp(cmd_name, "lvreduce"))
@ -122,10 +122,13 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv,
return 0;
}
if ((lp->mirrors = arg_count(cmd, mirrors_ARG)) &&
(arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) == SIGN_MINUS)) {
log_error("Mirrors argument may not be signed.");
return 0;
if (arg_is_set(cmd, mirrors_ARG)) {
if (arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) != SIGN_NONE) {
log_error("Mirrors argument may not be signed.");
return 0;
}
if ((lp->mirrors = arg_uint_value(cmd, mirrors_ARG, 0)))
lp->mirrors++;
}
if ((lp->stripes = arg_uint_value(cmd, stripes_ARG, 0)) &&