summaryrefslogtreecommitdiffstats
path: root/mdmon.c
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-05-17 03:08:16 +0200
committerNeilBrown <neilb@suse.de>2011-05-17 03:08:16 +0200
commitf4db7a6f3c3b9a0701f3063b287b7cb59ccecd07 (patch)
tree7ffa93bf1824c424d21c0d429c97542d37e3e1aa /mdmon.c
parentRAID-6 check standalone suspend array (diff)
downloadmdadm-f4db7a6f3c3b9a0701f3063b287b7cb59ccecd07.tar.xz
mdadm-f4db7a6f3c3b9a0701f3063b287b7cb59ccecd07.zip
mdmon: Fix crash if /proc/mdstat lists 0.9 superblocks
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'mdmon.c')
-rw-r--r--mdmon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdmon.c b/mdmon.c
index 1f39f165..a51a94fa 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -300,7 +300,8 @@ int main(int argc, char *argv[])
/* launch an mdmon instance for each container found */
mdstat = mdstat_read(0, 0);
for (e = mdstat; e; e = e->next) {
- if (strncmp(e->metadata_version, "external:", 9) == 0 &&
+ if (e->metadata_version &&
+ strncmp(e->metadata_version, "external:", 9) == 0 &&
!is_subarray(&e->metadata_version[9])) {
devname = devnum2devname(e->devnum);
/* update cmdline so this mdmon instance can be