dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

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

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