summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>2017-08-16 14:59:46 +0200
committerJes Sorensen <jsorensen@fb.com>2017-08-16 15:05:59 +0200
commit2dab69c9e3acace828bbb6a00514fa820f8ca64f (patch)
tree99cec08325cb4eec072b834b43534c22bd3b0b26
parentMonitor: containers don't have the same sysfs properties as arrays (diff)
downloadmdadm-2dab69c9e3acace828bbb6a00514fa820f8ca64f.tar.xz
mdadm-2dab69c9e3acace828bbb6a00514fa820f8ca64f.zip
Monitor: Include containers in spare migration
Spare migration doesn't work for external metadata. mdadm skips a container with spare device because it is inactive. It used to work because GET_ARRAY_INFO ioctl returned valid structure for a container and mdadm treated such response as active container. Current implementation checks it in sysfs where container is shown as inactive. Adapt sysfs implementation to work the same way as ioctl. Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r--Monitor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Monitor.c b/Monitor.c
index f70e5b59..497e3642 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -497,7 +497,7 @@ static int check_array(struct state *st, struct mdstat_ent *mdstat,
if (mse->level == NULL)
is_container = 1;
- if (!md_array_active(fd))
+ if (!is_container && !md_array_active(fd))
goto disappeared;
fcntl(fd, F_SETFD, FD_CLOEXEC);