Skip to contentSkip to conversation

master - raid: cleanup raid4/5/6/10 validation check

PATCH Heinz Mauelshagen 1 participant 1 message Oct 9, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3a639d81445a00974c5ccfd877a197adf5607b22
Commit:        3a639d81445a00974c5ccfd877a197adf5607b22
Parent:        44275c763c9c628152095aee9c99a8e078fc44d6
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Mon Oct 9 16:13:45 2017 +0200
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Mon Oct 9 16:13:45 2017 +0200

raid: cleanup raid4/5/6/10 validation check

---
 lib/metadata/merge.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
lib/metadata/merge.c +6 -4
index 711e7e7..9462a36 100644
@@ -169,11 +169,13 @@ static void _check_raid45610_seg(struct lv_segment *seg, int *error_count)
 	_check_raid_region_recovery(seg, error_count);
 	/* END: checks applying to any raid4/5/6/10 */
 
-	if (seg->lv->status & LV_RESHAPE_DATA_OFFSET) {
-		if (seg->data_offset > 1 && (seg->data_offset & (seg->lv->vg->extent_size - 1)))
+	if (seg->data_offset > 1) {
+		if (seg->lv->status & LV_RESHAPE_DATA_OFFSET) {
+			if (seg->data_offset & (seg->lv->vg->extent_size - 1))
+				raid_seg_error_val("data_offset", seg->data_offset);
+		} else
 			raid_seg_error_val("data_offset", seg->data_offset);
-	} else if (seg->data_offset)
-		raid_seg_error_val("data_offset", seg->data_offset);
+	}
 
 	/* Specific checks per raid level */
 	if (seg_is_raid4(seg) ||