diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-12-16 11:23:45 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-01-14 11:34:04 +0100 |
commit | 43897239b3cdd9ed9c1c7b795e171d9565d13116 (patch) | |
tree | 47a3c09a0f9eff0e458acd509825a6cf3934ad0d /tools/lvresize.c | |
parent | 526297296fb05bd8aea58f8b3d08a14045bf74e2 (diff) | |
download | lvm2-43897239b3cdd9ed9c1c7b795e171d9565d13116.tar.gz |
lvresize: check for poolmetadatasize arg earlier
Since we check for poolmetadatasize, we need to detect it before
actual test.
Diffstat (limited to 'tools/lvresize.c')
-rw-r--r-- | tools/lvresize.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/lvresize.c b/tools/lvresize.c index da9720504..93ad06842 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -46,6 +46,16 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv, * then metadata will be extended there. */ lp->sizeargs = arg_count(cmd, extents_ARG) + arg_count(cmd, size_ARG); + + if (arg_count(cmd, poolmetadatasize_ARG)) { + lp->poolmetadatasize = arg_uint64_value(cmd, poolmetadatasize_ARG, 0); + lp->poolmetadatasign = arg_sign_value(cmd, poolmetadatasize_ARG, SIGN_NONE); + if (lp->poolmetadatasign == SIGN_MINUS) { + log_error("Can't reduce pool metadata size."); + return 0; + } + } + if ((lp->sizeargs == 0) && (argc >= 2)) { lp->extents = 100; lp->percent = PERCENT_PVS; @@ -71,15 +81,6 @@ static int _lvresize_params(struct cmd_context *cmd, int argc, char **argv, lp->sign = arg_sign_value(cmd, size_ARG, SIGN_NONE); lp->percent = PERCENT_NONE; } - - if (arg_count(cmd, poolmetadatasize_ARG)) { - lp->poolmetadatasize = arg_uint64_value(cmd, poolmetadatasize_ARG, 0); - lp->poolmetadatasign = arg_sign_value(cmd, poolmetadatasize_ARG, SIGN_NONE); - if (lp->poolmetadatasign == SIGN_MINUS) { - log_error("Can't reduce pool metadata size."); - return 0; - } - } } if (lp->resize == LV_EXTEND && lp->sign == SIGN_MINUS) { |