* [PATCH] fix: segfault if subarray is monitored but container is not
@ 2011-01-13 13:22 Czarnowska, Anna
2011-01-17 1:09 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Czarnowska, Anna @ 2011-01-13 13:22 UTC (permalink / raw)
To: NeilBrown
Cc: linux-raid@vger.kernel.org, Williams, Dan J, Ciechanowski, Ed,
Hawrylewicz Czarnowski, Przemyslaw, Labun, Marcin,
Neubauer, Wojciech
From 7ea892adec6d2f383059b2a337db766735d7217f Mon Sep 17 00:00:00 2001
From: Anna Czarnowska <anna.czarnowska@intel.com>
Date: Thu, 13 Jan 2011 14:14:57 +0100
Subject: [PATCH] fix: segfault if subarray is monitored but container is not
In this situation to->parent is null so "to" doesn't change to
parent container and to->metadata is still null.
This results in segmentation fault when checking
to->metadata->ss->external.
We should just skip this array as container is needed to move spares to.
Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
---
Monitor.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Monitor.c b/Monitor.c
index db4e8cc..ab1ae26 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -833,6 +833,11 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
struct state *to = st;
unsigned long long min_size;
+ if (to->parent_dev != NoMdDev && !to->parent)
+ /* subarray monitored without parent container
+ * we can't move spares here */
+ continue;
+
if (to->parent)
/* member of a container */
to = to->parent;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fix: segfault if subarray is monitored but container is not
2011-01-13 13:22 [PATCH] fix: segfault if subarray is monitored but container is not Czarnowska, Anna
@ 2011-01-17 1:09 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-01-17 1:09 UTC (permalink / raw)
To: Czarnowska, Anna
Cc: linux-raid@vger.kernel.org, Williams, Dan J, Ciechanowski, Ed,
Hawrylewicz Czarnowski, Przemyslaw, Labun, Marcin,
Neubauer, Wojciech
On Thu, 13 Jan 2011 13:22:16 +0000 "Czarnowska, Anna"
<anna.czarnowska@intel.com> wrote:
> >From 7ea892adec6d2f383059b2a337db766735d7217f Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska <anna.czarnowska@intel.com>
> Date: Thu, 13 Jan 2011 14:14:57 +0100
> Subject: [PATCH] fix: segfault if subarray is monitored but container is not
>
> In this situation to->parent is null so "to" doesn't change to
> parent container and to->metadata is still null.
> This results in segmentation fault when checking
> to->metadata->ss->external.
> We should just skip this array as container is needed to move spares to.
>
> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
> ---
> Monitor.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/Monitor.c b/Monitor.c
> index db4e8cc..ab1ae26 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -833,6 +833,11 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
> struct state *to = st;
> unsigned long long min_size;
>
> + if (to->parent_dev != NoMdDev && !to->parent)
> + /* subarray monitored without parent container
> + * we can't move spares here */
> + continue;
> +
> if (to->parent)
> /* member of a container */
> to = to->parent;
Applied, thanks.
NeilBrown
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-17 1:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 13:22 [PATCH] fix: segfault if subarray is monitored but container is not Czarnowska, Anna
2011-01-17 1:09 ` NeilBrown
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).