From b6d7a7fbaa94b5e1d6e17742526282bce7259162 Mon Sep 17 00:00:00 2001 From: Jeff DeFouw Date: Tue, 29 Jun 2010 16:42:48 +1000 Subject: Fix parsing of inactive arrays in /proc/mdstat They don't have a level, so we should not expect one, and should expect devices instead. Signed-off-by: NeilBrown --- mdstat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mdstat.c b/mdstat.c index 4a9f370..fdca877 100644 --- 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); -- cgit