dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/0007-Assemble-mask-FAILFAST-and-WRITEMOSTLY-flags-when-fi.patch

5eacff
From 563ac108659980b3d1e226fe416254a86656235f Mon Sep 17 00:00:00 2001
5eacff
From: Gioh Kim <gi-oh.kim@cloud.ionos.com>
5eacff
Date: Tue, 6 Nov 2018 16:20:17 +0100
5eacff
Subject: [RHEL7.7 PATCH 07/24] Assemble: mask FAILFAST and WRITEMOSTLY flags
5eacff
 when finding the most recent device
5eacff
5eacff
If devices[].i.disk.state has MD_DISK_FAILFAST or MD_DISK_WRITEMOSTLY
5eacff
flag, it cannot be the most recent device. Both flags should be masked
5eacff
before checking the state.
5eacff
5eacff
Reviewed-by: NeilBrown <neilb@suse.com>
5eacff
Signed-off-by: Gioh Kim <gi-oh.kim@cloud.ionos.com>
5eacff
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
5eacff
---
5eacff
 Assemble.c | 5 ++++-
5eacff
 1 file changed, 4 insertions(+), 1 deletion(-)
5eacff
5eacff
diff --git a/Assemble.c b/Assemble.c
5eacff
index f39c9e1..9f75c68 100644
5eacff
--- a/Assemble.c
5eacff
+++ b/Assemble.c
5eacff
@@ -578,6 +578,7 @@ static int load_devices(struct devs *devices, char *devmap,
5eacff
 		struct supertype *tst;
5eacff
 		int i;
5eacff
 		int dfd;
5eacff
+		int disk_state;
5eacff
 
5eacff
 		if (tmpdev->used != 1)
5eacff
 			continue;
5eacff
@@ -711,7 +712,9 @@ static int load_devices(struct devs *devices, char *devmap,
5eacff
 		devices[devcnt].i.disk.major = major(stb.st_rdev);
5eacff
 		devices[devcnt].i.disk.minor = minor(stb.st_rdev);
5eacff
 
5eacff
-		if (devices[devcnt].i.disk.state == 6) {
5eacff
+		disk_state = devices[devcnt].i.disk.state & ~((1<
5eacff
+							      (1<
5eacff
+		if (disk_state == ((1<
5eacff
 			if (most_recent < 0 ||
5eacff
 			    devices[devcnt].i.events
5eacff
 			    > devices[most_recent].i.events) {
5eacff
-- 
5eacff
2.7.5
5eacff