summaryrefslogtreecommitdiff
path: root/tools/pvmove.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-08-15 19:31:04 +0200
committerHeinz Mauelshagen <heinzm@redhat.com>2016-08-15 19:31:04 +0200
commitd83f2d766d3177e2d2509f4fddb9b6f9c7fac7bc (patch)
tree2473ca11a3cbbe6fd4553e572c220a95f6b97369 /tools/pvmove.c
parent8e9d5d12ae3ac75852ebd74b64c28e31abb68d0e (diff)
downloadlvm2-d83f2d766d3177e2d2509f4fddb9b6f9c7fac7bc.tar.gz
pvmove: fix regression introduced with 8e9d5d12ae3ac75852ebd74b64c28e31abb68d0e
'pvmove -n name pv1 pv2' called with the name of a top-level LV failed with mentioned commit. Enhance pvmove-raid-segtypes.sh to test for prohibited RAID SubLV moves.
Diffstat (limited to 'tools/pvmove.c')
-rw-r--r--tools/pvmove.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c
index f491d58d8..3877562bb 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -163,7 +163,8 @@ static int _remove_sibling_pvs_from_trim_list(struct logical_volume *lv,
/* Give up with success unless @lv_name _and_ valid raid segment type */
if (!lv_name || !*lv_name ||
!seg_is_raid(first_seg(lv)) ||
- seg_is_raid0(first_seg(lv)))
+ seg_is_raid0(first_seg(lv)) ||
+ !strcmp(lv->name, lv_name))
return 1;
dm_list_init(&untrim_list);
@@ -427,6 +428,8 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
* for collocation (e.g. *rmeta_0 -> *rimage_0).
*
* Callee checks for lv_name and valid raid segment type.
+ *
+ * FIXME: don't rely on namespace
*/
if (!_remove_sibling_pvs_from_trim_list(lv, lv_name, &trim_list))
return_NULL;