From abd9618dd8b77ca1974074ae76fa6a08f1a687d9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 25 Feb 2016 20:40:28 +0100 Subject: [PATCH] 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 --- WHATS_NEW | 1 + tools/lvconvert.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 524fea466..250f3f1be 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index e7394c00d..3ec6d59ee 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -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);