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>
This commit is contained in:
Jeff DeFouw 2010-06-29 16:42:48 +10:00 committed by NeilBrown
parent ccaeea03a9
commit b6d7a7fbaa
1 changed files with 3 additions and 2 deletions

View File

@ -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);