]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: fix interim segtype regression on raid6 conversions
authorHeinz Mauelshagen <heinzm@redhat.com>
Fri, 7 Sep 2018 11:48:13 +0000 (13:48 +0200)
committerMarian Csontos <mcsontos@redhat.com>
Mon, 10 Sep 2018 09:21:02 +0000 (11:21 +0200)
When converting from striped/raid0/raid0_meta
to raid6 with > 2 stripes, allow possible
direct conversion (to raid6_n_6).

In case of 2 stripes, first convert to raid5_n to restripe
to at least 3 data stripes (the raid6 minimum in lvm2) in
a second conversion before finally converting to raid6_n_6.

As before, raid6_n_6 then can be converted
to any other raid6 layout.

Enhance lvconvert-raid-takeover.sh to test the
2 stripes conversions to raid6.

Resolves: rhbz1624038
(cherry picked from commit e2e30a64ab10602951443dfbd3481bd6b32f5459)

Conflicts:
WHATS_NEW

WHATS_NEW
lib/metadata/raid_manip.c
test/shell/lvconvert-raid-takeover.sh

index 8def00d4a9c24cc349b1c7911090fe0cae330a33..a6bd6a398fd242b206744ff5745c9ab0506ca684 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.182 - 
 ==============================
+  Fix lvconvert striped/raid0/raid0_meta -> raid6 regression.
   Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
   Fix pvs with lvmetad to avoid too many open files from filter reads.
   Fix pvscan --cache to avoid too many open files from filter reads.
index 3eee77a96ec3952323e1d43242c53a3c1e0e3b83..cb7202a2dbe701226439b1c9e1d598e961d5e59b 100644 (file)
@@ -6137,10 +6137,10 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
        /* striped/raid0 -> */
        } else if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) {
                if (segtype_is_any_raid6(*segtype))
-                       seg_flag = SEG_RAID6_N_6;
+                       seg_flag = seg_from->area_count < 3 ? SEG_RAID5_N : SEG_RAID6_N_6;
 
-               if (segtype_is_linear(*segtype) ||
-                   (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
+               else if (segtype_is_linear(*segtype) ||
+                        (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
                        seg_flag = SEG_RAID5_N;
 
        /* raid1 -> */
index d1c5d305b9f8e6efb0ef40a1396d160f9ff2ed9a..d22c11b0c21ba3b1422fde03673fdb7128dc98f2 100644 (file)
@@ -108,11 +108,19 @@ function _invalid_raid5_conversions
        not _lvconvert raid6 raid6_n_6 4 6 $vg $lv1
 }
 
-# Check raid6 conversion constrainst of minimum 3 stripes
-_lvcreate striped 2 2 4m $vg $lv1
-not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1
-lvremove -y $vg
+# Check raid6 conversion constrainst for 2 stripes
+for type in striped raid0 raid0_meta
+do
+   _lvcreate $type 2 2 4m $vg $lv1
+   not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1
+   _lvconvert raid6 raid5_n 2 3 $vg $lv1
+   _lvconvert raid6 raid5_n 3 4 $vg $lv1
+   _lvconvert raid6 raid6_n_6 3 5 $vg $lv1
+   lvremove -y $vg
+done
 
+
+# Check raid6 conversion constrainst of minimum 3 stripes
 _lvcreate raid0 3 3 4m $vg $lv1
 _lvconvert raid6 raid6_n_6 3 5 $vg $lv1
 lvremove -y $vg
This page took 0.061892 seconds and 5 git commands to generate.