mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvresize: check for poolmetadatasize arg earlier
Since we check for poolmetadatasize, we need to detect it before actual test.
This commit is contained in:
parent
526297296f
commit
43897239b3
@ -1,5 +1,6 @@
|
||||
Version 2.02.140 -
|
||||
===================================
|
||||
Eval poolmetadatasize arg earlier in lvresize.
|
||||
Fix vgcfgrestore to respect allocatable attribute of PVs.
|
||||
Add report/mark_hidden_devices to lvm.conf.
|
||||
Use brackets consistently in report fields to mark hidden devices.
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user