Blame SOURCES/0027-Assemble.c-Don-t-ignore-faulty-disk-when-array-is-au.patch

d922d5
From 7298c9a6facea469d9e7ed55a7a0806500096415 Mon Sep 17 00:00:00 2001
d922d5
From: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
d922d5
Date: Thu, 7 Jun 2018 14:47:47 +0200
d922d5
Subject: [RHEL7.5 PATCH 1/1] Assemble.c Don't ignore faulty disk when array is
d922d5
 auto assembled.
d922d5
d922d5
Since commit 20dc76d15b40 ("imsm: Set disk slot number") mdadm
d922d5
sets slot number for each disk in imsm array. Now auto-assemble determines
d922d5
devices using slot number and ignores devices on the same slot that have
d922d5
older generation number.
d922d5
It causes infinit loop if failed device is still visible in system
d922d5
(it has metadata, but it is not merged with exisiting array).
d922d5
d922d5
To avoid it, out-of-sync device should be added to the best[]. Later
d922d5
mdadm adds it as spare to the container.
d922d5
d922d5
Imsm doesn't support disk replacement feature, so it can use rooms for
d922d5
replacements.
d922d5
d922d5
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
d922d5
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
d922d5
---
d922d5
 Assemble.c | 2 ++
d922d5
 1 file changed, 2 insertions(+)
d922d5
d922d5
diff --git a/Assemble.c b/Assemble.c
d922d5
index e83d550..32e6f6f 100644
d922d5
--- a/Assemble.c
d922d5
+++ b/Assemble.c
d922d5
@@ -779,6 +779,8 @@ static int load_devices(struct devs *devices, char *devmap,
d922d5
 			if (best[i] == -1 || (devices[best[i]].i.events
d922d5
 					      < devices[devcnt].i.events))
d922d5
 				best[i] = devcnt;
d922d5
+			else if (st->ss == &super_imsm)
d922d5
+				best[i+1] = devcnt;
d922d5
 		}
d922d5
 		devcnt++;
d922d5
 	}
d922d5
-- 
d922d5
2.7.4
d922d5