Blame SOURCES/lvm2-2_02_182-lvconvert-fix-direct-raid0-to-striped-conversion.patch

0d8a0a
 WHATS_NEW                             |  1 +
0d8a0a
 lib/metadata/raid_manip.c             |  3 +++
0d8a0a
 test/shell/lvconvert-raid0-striped.sh | 25 +++++++++++++++++++++++++
0d8a0a
 3 files changed, 29 insertions(+)
0d8a0a
 create mode 100644 test/shell/lvconvert-raid0-striped.sh
0d8a0a
0d8a0a
diff --git a/WHATS_NEW b/WHATS_NEW
0d8a0a
index 6560357..e3eee56 100644
0d8a0a
--- a/WHATS_NEW
0d8a0a
+++ b/WHATS_NEW
0d8a0a
@@ -1,5 +1,6 @@
0d8a0a
 Version 2.02.182 - 
0d8a0a
 ==============================
0d8a0a
+  Fix lvconvert raid0/raid0_meta -> striped regression.
0d8a0a
   Fix lvconvert --splitmirror for mirror type (2.02.178).
0d8a0a
   Do not pair cache policy and cache metadata format.
0d8a0a
 
0d8a0a
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
0d8a0a
index 705a7f9..804f78b 100644
0d8a0a
--- a/lib/metadata/raid_manip.c
0d8a0a
+++ b/lib/metadata/raid_manip.c
0d8a0a
@@ -6136,6 +6136,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
0d8a0a
 		if (seg_from->area_count == 1)
0d8a0a
 			seg_flag = SEG_RAID1;
0d8a0a
 
0d8a0a
+		else if (seg_is_any_raid0(seg_from) && segtype_is_striped(*segtype))
0d8a0a
+			;
0d8a0a
+
0d8a0a
 		/* If this is any raid5 conversion request -> enforce raid5_n, because we convert from striped */
0d8a0a
 		else if (((segtype_is_striped(*segtype) && !segtype_is_any_raid0(*segtype)) || segtype_is_any_raid5(*segtype)) &&
0d8a0a
 			 !segtype_is_raid5_n(*segtype))
0d8a0a
diff --git a/test/shell/lvconvert-raid0-striped.sh b/test/shell/lvconvert-raid0-striped.sh
0d8a0a
new file mode 100644
0d8a0a
index 0000000..4521b34
0d8a0a
--- /dev/null
0d8a0a
+++ b/test/shell/lvconvert-raid0-striped.sh
0d8a0a
@@ -0,0 +1,25 @@
0d8a0a
+#!/usr/bin/env bash
0d8a0a
+
0d8a0a
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
0d8a0a
+#
0d8a0a
+# This copyrighted material is made available to anyone wishing to use,
0d8a0a
+# modify, copy, or redistribute it subject to the terms and conditions
0d8a0a
+# of the GNU General Public License v.2.
0d8a0a
+#
0d8a0a
+# You should have received a copy of the GNU General Public License
0d8a0a
+# along with this program; if not, write to the Free Software Foundation,
0d8a0a
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0d8a0a
+
0d8a0a
+
0d8a0a
+SKIP_WITH_LVMPOLLD=1
0d8a0a
+
0d8a0a
+. lib/inittest
0d8a0a
+
0d8a0a
+aux have_raid 1 7 0 || skip
0d8a0a
+
0d8a0a
+aux prepare_vg 3 16
0d8a0a
+
0d8a0a
+lvcreate -aey --type raid0 -i 3 -l3 -n $lv $vg
0d8a0a
+lvconvert -y --type striped $vg/$lv
0d8a0a
+check lv_field $vg/$lv segtype "striped"
0d8a0a
+vgremove -ff $vg