[lvm-devel] master - raid: correct raid6_n_6 -> raid5 convenience type

Alasdair Kergon agk at sourceware.org
Tue Nov 14 14:41:45 UTC 2017


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ebd0fed0ceb982503ac474c2e6579a45a983e305
Commit:        ebd0fed0ceb982503ac474c2e6579a45a983e305
Parent:        00acae12a4295075f1b93786f60327e5d3c26e70
Author:        Heinz Mauelshagen <heinzm at redhat.com>
AuthorDate:    Mon Nov 13 18:03:50 2017 +0100
Committer:     Alasdair G Kergon <agk at redhat.com>
CommitterDate: Tue Nov 14 14:41:06 2017 +0000

raid: correct raid6_n_6 -> raid5 convenience type

Fix "lvconvert --type raid5 RaidLV" on a "raid6_n_6" LV offering
false "raid6_ls_6" instead of "raid5_n".
---
 lib/metadata/raid_manip.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index a904666..2d8aaed 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6141,9 +6141,12 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
 			seg_flag = SEG_RAID6_N_6;
 
 		} else if (segtype_is_any_raid5(*segtype))
-			/* No result for raid6_{zr,nr,nc} */
-			if (!(seg_flag = _raid_seg_flag_6_to_5(seg_from)) ||
-			    !(seg_flag & (*segtype)->flags))
+			if (!(seg_flag = _raid_seg_flag_6_to_5(seg_from)))
+				/*
+				 * No result for raid6_{zr,nr,nc}.
+				 *
+				 * Offer to convert to corresponding raid6_*_6 type first.
+				 */
 				seg_flag = _raid_segtype_flag_5_to_6(*segtype);
 
 	/* -> raid1 */




More information about the lvm-devel mailing list