|
|
5e29a5 |
From 2ee0f6d4ddd6c602def295e3b1dfccbd8a50a4c8 Mon Sep 17 00:00:00 2001
|
|
|
5e29a5 |
From: Heinz Mauelshagen <heinzm@redhat.com>
|
|
|
5e29a5 |
Date: Fri, 7 Sep 2018 13:48:13 +0200
|
|
|
5e29a5 |
Subject: [PATCH] lvconvert: fix interim segtype regression on raid6
|
|
|
5e29a5 |
conversions
|
|
|
5e29a5 |
|
|
|
5e29a5 |
When converting from striped/raid0/raid0_meta
|
|
|
5e29a5 |
to raid6 with > 2 stripes, allow possible
|
|
|
5e29a5 |
direct conversion (to raid6_n_6).
|
|
|
5e29a5 |
|
|
|
5e29a5 |
In case of 2 stripes, first convert to raid5_n to restripe
|
|
|
5e29a5 |
to at least 3 data stripes (the raid6 minimum in lvm2) in
|
|
|
5e29a5 |
a second conversion before finally converting to raid6_n_6.
|
|
|
5e29a5 |
|
|
|
5e29a5 |
As before, raid6_n_6 then can be converted
|
|
|
5e29a5 |
to any other raid6 layout.
|
|
|
5e29a5 |
|
|
|
5e29a5 |
Enhance lvconvert-raid-takeover.sh to test the
|
|
|
5e29a5 |
2 stripes conversions to raid6.
|
|
|
5e29a5 |
|
|
|
5e29a5 |
Resolves: rhbz1624038
|
|
|
5e29a5 |
(cherry picked from commit e2e30a64ab10602951443dfbd3481bd6b32f5459)
|
|
|
5e29a5 |
|
|
|
5e29a5 |
Conflicts:
|
|
|
5e29a5 |
WHATS_NEW
|
|
|
5e29a5 |
|
|
|
5e29a5 |
(cherry picked from commit c26bde42af0930bef2cee95c76951285d801ba70)
|
|
|
5e29a5 |
---
|
|
|
5e29a5 |
WHATS_NEW | 1 +
|
|
|
5e29a5 |
lib/metadata/raid_manip.c | 6 +++---
|
|
|
5e29a5 |
test/shell/lvconvert-raid-takeover.sh | 16 ++++++++++++----
|
|
|
5e29a5 |
3 files changed, 16 insertions(+), 7 deletions(-)
|
|
|
5e29a5 |
|
|
|
5e29a5 |
diff --git a/WHATS_NEW b/WHATS_NEW
|
|
|
5e29a5 |
index 9da40b6..d8a24b0 100644
|
|
|
5e29a5 |
--- a/WHATS_NEW
|
|
|
5e29a5 |
+++ b/WHATS_NEW
|
|
|
5e29a5 |
@@ -1,5 +1,6 @@
|
|
|
5e29a5 |
Version 2.02.182 -
|
|
|
5e29a5 |
==============================
|
|
|
5e29a5 |
+ Fix lvconvert striped/raid0/raid0_meta -> raid6 regression.
|
|
|
5e29a5 |
Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
|
|
|
5e29a5 |
Fix lvconvert conversion attempts to linear.
|
|
|
5e29a5 |
Fix lvconvert raid0/raid0_meta -> striped regression.
|
|
|
5e29a5 |
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
|
|
|
5e29a5 |
index 3eee77a..cb7202a 100644
|
|
|
5e29a5 |
--- a/lib/metadata/raid_manip.c
|
|
|
5e29a5 |
+++ b/lib/metadata/raid_manip.c
|
|
|
5e29a5 |
@@ -6137,10 +6137,10 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
|
|
|
5e29a5 |
/* striped/raid0 -> */
|
|
|
5e29a5 |
} else if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) {
|
|
|
5e29a5 |
if (segtype_is_any_raid6(*segtype))
|
|
|
5e29a5 |
- seg_flag = SEG_RAID6_N_6;
|
|
|
5e29a5 |
+ seg_flag = seg_from->area_count < 3 ? SEG_RAID5_N : SEG_RAID6_N_6;
|
|
|
5e29a5 |
|
|
|
5e29a5 |
- if (segtype_is_linear(*segtype) ||
|
|
|
5e29a5 |
- (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
|
|
|
5e29a5 |
+ else if (segtype_is_linear(*segtype) ||
|
|
|
5e29a5 |
+ (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype)))
|
|
|
5e29a5 |
seg_flag = SEG_RAID5_N;
|
|
|
5e29a5 |
|
|
|
5e29a5 |
/* raid1 -> */
|
|
|
5e29a5 |
diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh
|
|
|
5e29a5 |
index d1c5d30..d22c11b 100644
|
|
|
5e29a5 |
--- a/test/shell/lvconvert-raid-takeover.sh
|
|
|
5e29a5 |
+++ b/test/shell/lvconvert-raid-takeover.sh
|
|
|
5e29a5 |
@@ -108,11 +108,19 @@ function _invalid_raid5_conversions
|
|
|
5e29a5 |
not _lvconvert raid6 raid6_n_6 4 6 $vg $lv1
|
|
|
5e29a5 |
}
|
|
|
5e29a5 |
|
|
|
5e29a5 |
-# Check raid6 conversion constrainst of minimum 3 stripes
|
|
|
5e29a5 |
-_lvcreate striped 2 2 4m $vg $lv1
|
|
|
5e29a5 |
-not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1
|
|
|
5e29a5 |
-lvremove -y $vg
|
|
|
5e29a5 |
+# Check raid6 conversion constrainst for 2 stripes
|
|
|
5e29a5 |
+for type in striped raid0 raid0_meta
|
|
|
5e29a5 |
+do
|
|
|
5e29a5 |
+ _lvcreate $type 2 2 4m $vg $lv1
|
|
|
5e29a5 |
+ not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1
|
|
|
5e29a5 |
+ _lvconvert raid6 raid5_n 2 3 $vg $lv1
|
|
|
5e29a5 |
+ _lvconvert raid6 raid5_n 3 4 $vg $lv1
|
|
|
5e29a5 |
+ _lvconvert raid6 raid6_n_6 3 5 $vg $lv1
|
|
|
5e29a5 |
+ lvremove -y $vg
|
|
|
5e29a5 |
+done
|
|
|
5e29a5 |
|
|
|
5e29a5 |
+
|
|
|
5e29a5 |
+# Check raid6 conversion constrainst of minimum 3 stripes
|
|
|
5e29a5 |
_lvcreate raid0 3 3 4m $vg $lv1
|
|
|
5e29a5 |
_lvconvert raid6 raid6_n_6 3 5 $vg $lv1
|
|
|
5e29a5 |
lvremove -y $vg
|
|
|
5e29a5 |
--
|
|
|
5e29a5 |
1.8.3.1
|
|
|
5e29a5 |
|