dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/Monitor-Include-containers-in-spare-migration2.patch

2c1b57
From 2dab69c9e3acace828bbb6a00514fa820f8ca64f Mon Sep 17 00:00:00 2001
2c1b57
From: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
2c1b57
Date: Wed, 16 Aug 2017 14:59:46 +0200
2c1b57
Subject: [RHEL7.5 PATCH 169/169] Monitor: Include containers in spare
2c1b57
 migration
2c1b57
2c1b57
Spare migration doesn't work for external metadata. mdadm skips
2c1b57
a container with spare device because it is inactive. It used to work
2c1b57
because GET_ARRAY_INFO ioctl returned valid structure for a container
2c1b57
and mdadm treated such response as active container. Current
2c1b57
implementation checks it in sysfs where container is shown as inactive.
2c1b57
2c1b57
Adapt sysfs implementation to work the same way as ioctl.
2c1b57
2c1b57
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Monitor.c | 2 +-
2c1b57
 1 file changed, 1 insertion(+), 1 deletion(-)
2c1b57
2c1b57
diff --git a/Monitor.c b/Monitor.c
2c1b57
index f70e5b5..497e364 100644
2c1b57
--- a/Monitor.c
2c1b57
+++ b/Monitor.c
2c1b57
@@ -497,7 +497,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
2c1b57
 	if (mse->level == NULL)
2c1b57
 		is_container = 1;
2c1b57
 
2c1b57
-	if (!md_array_active(fd))
2c1b57
+	if (!is_container && !md_array_active(fd))
2c1b57
 		goto disappeared;
2c1b57
 
2c1b57
 	fcntl(fd, F_SETFD, FD_CLOEXEC);
2c1b57
-- 
2c1b57
2.7.4
2c1b57