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:
parent
ccaeea03a9
commit
b6d7a7fbaa
5
mdstat.c
5
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);
|
||||
|
|
Loading…
Reference in New Issue