linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Czarnowska, Anna" <anna.czarnowska@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Ciechanowski, Ed" <ed.ciechanowski@intel.com>,
	"Hawrylewicz Czarnowski,
	Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com>,
	"Labun, Marcin" <Marcin.Labun@intel.com>,
	"Neubauer, Wojciech" <Wojciech.Neubauer@intel.com>
Subject: Re: [PATCH] fix: segfault if subarray is monitored but container is not
Date: Mon, 17 Jan 2011 12:09:13 +1100	[thread overview]
Message-ID: <20110117120913.57c88d1b@notabene.brown> (raw)
In-Reply-To: <A9DE54D0CD747C4CB06DCE5B6FA2246F010E8FDE84@irsmsx504.ger.corp.intel.com>

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


      reply	other threads:[~2011-01-17  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=20110117120913.57c88d1b@notabene.brown \
    --to=neilb@suse.de \
    --cc=Marcin.Labun@intel.com \
    --cc=Wojciech.Neubauer@intel.com \
    --cc=anna.czarnowska@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=przemyslaw.hawrylewicz.czarnowski@intel.com \
    /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).