summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff DeFouw <jeffd@i2k.com>2010-06-29 16:42:48 +1000
committerNeilBrown <neilb@suse.de>2010-06-29 16:42:48 +1000
commitb6d7a7fbaa94b5e1d6e17742526282bce7259162 (patch)
treedcb00e06407ff81d51d5e0359c627656b3b52668
parentccaeea03a9c0ae5737a95c4bc7252bddeddbb132 (diff)
downloadmdadm-b6d7a7fbaa94b5e1d6e17742526282bce7259162.tar.gz
mdadm-b6d7a7fbaa94b5e1d6e17742526282bce7259162.tar.xz
mdadm-b6d7a7fbaa94b5e1d6e17742526282bce7259162.zip
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 <neilb@suse.de>
-rw-r--r--mdstat.c5
1 files 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);