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

lvconvert: fix vg parameter

Since we want to read env LVM_VG_NAME vg names,
we cannot just check LV names which do contain '/'.

So before the patch commands like:

> lvconvert --repair vg

Before:

Please provide a valid volume group name

After:
Path required for Logical Volume "vg".
Please provide a valid volume group name

> LVM_VG_NAME=vg lvconvert --repair vg

Before:
Please provide a valid volume group name

After:
Can't find LV vg in VG vg
This commit is contained in:
Zdenek Kabelac 2016-02-25 20:40:28 +01:00
parent a68e601886
commit abd9618dd8
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.144 -
=====================================
Improve support for env LVM_VG_NAME for reference VG name in lvconvert.
Fix regresion when lvresize accepted zero sizes (2.02.141).
Always warn user about PV in use even when pvremove uses --force --force.
Use uninitilized pool header detection in all cases.

View File

@ -173,8 +173,7 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
if (!validate_restricted_lvname_param(cmd, &lp->vg_name, &lp->lv_split_name))
return_0;
if (strchr(lp->lv_name_full, '/') &&
(vg_name = extract_vgname(cmd, lp->lv_name_full)) &&
if ((vg_name = extract_vgname(cmd, lp->lv_name_full)) &&
lp->vg_name && strcmp(vg_name, lp->vg_name)) {
log_error("Please use a single volume group name "
"(\"%s\" or \"%s\")", vg_name, lp->vg_name);