Jeff DeFouw: Fix parsing of inactive arrays in /proc/mdstat

Martin F. Krafft madduck at alioth.debian.org
Sun Aug 29 11:54:55 UTC 2010


Module: mdadm
Branch: fixes/udev-blkid
Commit: b6d7a7fbaa94b5e1d6e17742526282bce7259162
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=b6d7a7fbaa94b5e1d6e17742526282bce7259162

Author: Jeff DeFouw <jeffd at i2k.com>
Date:   Tue Jun 29 16:42:48 2010 +1000

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 at suse.de>

---

 mdstat.c |    5 +++--
 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);




More information about the pkg-mdadm-commits mailing list