]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Fix parsing of inactive arrays in /proc/mdstat
authorJeff DeFouw <jeffd@i2k.com>
Tue, 29 Jun 2010 06:42:48 +0000 (16:42 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 29 Jun 2010 06:42:48 +0000 (16:42 +1000)
They don't have a level, so we should not expect one, and should
expect devices instead.

Signed-off-by: NeilBrown <neilb@suse.de>
mdstat.c

index 4a9f370060f36839792dfcd708bf3a23fed72c49..fdca877b741819020767d903410fb0abb5c3b6e3 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -168,9 +168,10 @@ struct mdstat_ent *mdstat_read(int hold, int start)
                        char *eq;
                        if (strcmp(w, "active")==0)
                                ent->active = 1;
-                       else if (strcmp(w, "inactive")==0)
+                       else if (strcmp(w, "inactive")==0) {
                                ent->active = 0;
-                       else if (ent->active >=0 &&
+                               in_devs = 1;
+                       } else if (ent->active > 0 &&
                                 ent->level == NULL &&
                                 w[0] != '(' /*readonly*/) {
                                ent->level = strdup(w);