]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Examine: don't count containers as spares
authorDan Williams <dan.j.williams@intel.com>
Tue, 15 Sep 2009 18:35:28 +0000 (11:35 -0700)
committerDan Williams <dan.j.williams@intel.com>
Tue, 15 Sep 2009 18:35:28 +0000 (11:35 -0700)
mdadm -Ebs will include containers in the scanned device list.
Examine() falsely thinks they are spares when MD_DISK_SYNC is not set.
This could be fixed by forcing all formats to set this flag for
container devices, but this flag is currently used by imsm to identify
free-floating spares.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Examine.c

index d4904bc96d075cdc08e30ffb48109ee98279a451..7fbd4ae2cf932e5decd61b5a32c97177d1fe8dbb 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -118,7 +118,8 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
                                st->ss->getinfo_super(st, &ap->info);
                        } else
                                st->ss->getinfo_super(st, &ap->info);
-                       if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
+                       if (!st->loaded_container &&
+                           !(ap->info.disk.state & (1<<MD_DISK_SYNC)))
                                ap->spares++;
                        d = dl_strdup(devlist->devname);
                        dl_add(ap->devs, d);