dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/imsm-Write-empty-PPL-header-if-assembling-regular-cl.patch

b7f731
From 50b9c10da0e7c153744b548680147dc8cc7c4c72 Mon Sep 17 00:00:00 2001
b7f731
From: Pawel Baldysiak <pawel.baldysiak@intel.com>
b7f731
Date: Thu, 28 Sep 2017 14:41:15 +0200
b7f731
Subject: [PATCH 09/12] imsm: Write empty PPL header if assembling
b7f731
 regular clean array.
b7f731
b7f731
If array was initially assembled with kernel without PPL support -
b7f731
initial header was never written to the drive.
b7f731
If initial resync was completed and system is rebooted to kernel with
b7f731
PPL support - mdadm prevents from assembling normal clean array
b7f731
due to lack of valid PPL.
b7f731
Write empty header when assemble normal clean array, so the
b7f731
its assamble is no longer blocked.
b7f731
b7f731
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
b7f731
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
b7f731
---
b7f731
 super-intel.c | 4 +++-
b7f731
 1 file changed, 3 insertions(+), 1 deletion(-)
b7f731
b7f731
diff --git a/super-intel.c b/super-intel.c
b7f731
index 7b2327b..501d0c3 100644
b7f731
--- a/super-intel.c
b7f731
+++ b/super-intel.c
b7f731
@@ -6225,7 +6225,9 @@ out:
b7f731
 	}
b7f731
 
b7f731
 	if (ret == 1) {
b7f731
-		if (map->map_state == IMSM_T_STATE_UNINITIALIZED)
b7f731
+		if (map->map_state == IMSM_T_STATE_UNINITIALIZED ||
b7f731
+		   (map->map_state == IMSM_T_STATE_NORMAL &&
b7f731
+		   !(dev->vol.dirty & RAIDVOL_DIRTY)))
b7f731
 			ret = st->ss->write_init_ppl(st, info, d->fd);
b7f731
 		else
b7f731
 			info->mismatch_cnt++;
b7f731
-- 
b7f731
2.7.4
b7f731