From: Adam Kwolek <adam.kwolek@intel.com>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
ed.ciechanowski@intel.com
Subject: [PATCH 14/21] FIX: Level field can be NULL
Date: Tue, 23 Nov 2010 13:41:32 +0100 [thread overview]
Message-ID: <20101123124132.17770.86136.stgit@gklab-170-024.igk.intel.com> (raw)
In-Reply-To: <20101123123900.17770.75516.stgit@gklab-170-024.igk.intel.com>
When array changes its shape/level or array is about closing
level field in mdstat can be NULL. This causes core dump in mdmon.
Patch introduces guard in code for this situation.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---
mdadm/mdadm/mdstat.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mdadm/mdadm/mdstat.c b/mdadm/mdadm/mdstat.c
index aecd1d4..1f818b1 100644
--- a/mdadm/mdadm/mdstat.c
+++ b/mdadm/mdadm/mdstat.c
@@ -291,6 +291,8 @@ struct mdstat_ent *mdstat_read(int hold, int start)
int mdstat_to_level(struct mdstat_ent *ms)
{
+ if (ms->level == NULL)
+ return LEVEL_UNSUPPORTED;
if (strncmp(ms->level, "raid0", 5) == 0)
return 0;
else if (strncmp(ms->level, "raid10", 6) == 0)
next prev parent reply other threads:[~2010-11-23 12:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-23 12:39 [PATCH 00/21] Series short description Adam Kwolek
2010-11-23 12:39 ` [PATCH 01/21] imsm: Remove unnecessary code Adam Kwolek
2010-11-23 12:39 ` [PATCH 02/21] imsm: Change some debug output information Adam Kwolek
2010-11-23 12:40 ` [PATCH 03/21] imsm: FIX: imsm_check_reshape_conditions change ret_val Adam Kwolek
2010-11-23 12:40 ` [PATCH 04/21] FIX: Use MDADM_EXPERIMENTAL environment variable Adam Kwolek
2010-11-23 12:40 ` [PATCH 05/21] FIX: Allow for reshape without backup file Adam Kwolek
2010-11-23 12:40 ` [PATCH 06/21] imsm: FIX: Guard size setting Adam Kwolek
2010-11-23 12:40 ` [PATCH 07/21] imsm: FIX: Reshape Cancel message on 2nd array doesn't work correctly Adam Kwolek
2010-11-23 12:40 ` [PATCH 08/21] imsm: FIX: Continue expansion after -As command Adam Kwolek
2010-11-23 12:40 ` [PATCH 09/21] FIX: Cannot exit monitor after takeover Adam Kwolek
2010-11-23 12:40 ` [PATCH 10/21] FIX: Unfreeze not only container for external metadata Adam Kwolek
2010-11-23 12:41 ` [PATCH 11/21] FIX: Honor !reshape state on wait_reshape() entry Adam Kwolek
2010-11-23 12:41 ` [PATCH 12/21] WORKAROUND: md reports idle state during reshape start Adam Kwolek
2010-11-23 12:41 ` [PATCH 13/21] imsm Fix: Core during rebuild on array details read Adam Kwolek
2010-11-23 12:41 ` Adam Kwolek [this message]
2010-11-23 12:41 ` [PATCH 15/21] FIX: Checkpointing: Enable checkpointing for non-growing migrations Adam Kwolek
2010-11-23 12:41 ` [PATCH 16/21] FIX: Start mdmon after changing level Adam Kwolek
2010-11-23 12:41 ` [PATCH 17/21] Change manage_reshape() placement Adam Kwolek
2010-11-23 12:42 ` [PATCH 18/21] imsm: Use geo structure Adam Kwolek
2010-11-23 12:42 ` [PATCH 19/21] Migration: raid5->raid0 Adam Kwolek
2010-11-23 12:42 ` [PATCH 20/21] Migration raid0->raid5 Adam Kwolek
2010-11-23 12:42 ` [PATCH 21/21] Migration: Chunk size migration Adam Kwolek
2010-11-24 5:04 ` [PATCH 00/21] Series short description Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101123124132.17770.86136.stgit@gklab-170-024.igk.intel.com \
--to=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).