]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Monitor: Include containers in spare migration
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Wed, 16 Aug 2017 12:59:46 +0000 (14:59 +0200)
committerJes Sorensen <jsorensen@fb.com>
Wed, 16 Aug 2017 13:05:59 +0000 (09:05 -0400)
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>
Monitor.c

index f70e5b59f789c0fe916c290a7b4cce932a13eac6..497e3642507be147536d7743c0b8d0f11e350156 100644 (file)
--- 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);