mdadm/mdmon-0.9-superblock-crash.patch
OBS User autobuild 4f09ed47ae Accepting request 42186 from Base:System
Copy from Base:System/mdadm based on submit request 42186 from user michal-m

OBS-URL: https://build.opensuse.org/request/show/42186
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=43
2010-06-29 14:43:02 +00:00

23 lines
821 B
Diff

From c4dc5c0aa7aa412bf85f0f6d646ea0c307eb4591 Mon Sep 17 00:00:00 2001
From: Michal Marek <mmarek@suse.cz>
Date: Fri, 19 Mar 2010 11:59:20 +0100
Subject: [PATCH] mdmon: Fix crash if /proc/mdstat lists 0.9 superblocks
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
mdmon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- mdadm-3.0.3.orig/mdmon.c
+++ mdadm-3.0.3/mdmon.c
@@ -313,7 +313,8 @@ int main(int argc, char *argv[])
scan = 1;
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