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] Monitor: skip array if error getting size
Date: Wed, 12 Jan 2011 16:18:42 +1100	[thread overview]
Message-ID: <20110112161842.22744002@notabene.brown> (raw)
In-Reply-To: <A9DE54D0CD747C4CB06DCE5B6FA2246F010E87582C@irsmsx504.ger.corp.intel.com>

On Tue, 11 Jan 2011 13:09:55 +0000 "Czarnowska, Anna"
<anna.czarnowska@intel.com> wrote:

> >From 10d178721c3870ea5802a30ea3f008f9f379551a Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska <anna.czarnowska@intel.com>
> Date: Tue, 11 Jan 2011 12:36:37 +0100
> Subject: [PATCH] Monitor: skip array if error getting size
> Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
> 
> load_super tries to load container first anyway but if it fails
> eg. after physically removing a disk
> then it tries to read metadata from container device.
> This will always fail and print confusing errors.
> So use load_container instead of load_super on container.
> 
> On failure to read metadata we should skip this array.
> It will be dealt with the next time round.
> 
> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>

Applied, thanks.

BTW, load_super should try load_container any longer, so I have removed that
- thanks for the reminder.

NeilBrown


> ---
>  Monitor.c |   21 +++++++++++++--------
>  1 files changed, 13 insertions(+), 8 deletions(-)
> 
> diff --git a/Monitor.c b/Monitor.c
> index 18462f2..db4e8cc 100644
> --- a/Monitor.c
> +++ b/Monitor.c
> @@ -702,24 +702,28 @@ static int add_new_arrays(struct mdstat_ent *mdstat, struct state **statelist,
>  	return new_found;
>  }
>  
> -unsigned long long min_spare_size_required(struct state *st)
> +static int get_min_spare_size_required(struct state *st, unsigned long long *sizep)
>  {
>  	int fd;
> -	unsigned long long rv = 0;
>  
>  	if (!st->metadata ||
>  	    !st->metadata->ss->min_acceptable_spare_size)
> -		return rv;
> +		return 0;
>  
>  	fd = open(st->devname, O_RDONLY);
>  	if (fd < 0)
> -		return 0;
> -	st->metadata->ss->load_super(st->metadata, fd, st->devname);
> +		return 1;
> +	if (st->metadata->ss->external)
> +		st->metadata->ss->load_container(st->metadata, fd, st->devname);
> +	else
> +		st->metadata->ss->load_super(st->metadata, fd, st->devname);
>  	close(fd);
> -	rv = st->metadata->ss->min_acceptable_spare_size(st->metadata);
> +	if (!st->metadata->sb)
> +		return 1;
> +	*sizep = st->metadata->ss->min_acceptable_spare_size(st->metadata);
>  	st->metadata->ss->free_super(st->metadata);
>  
> -	return rv;
> +	return 0;
>  }
>  
>  static int check_donor(struct state *from, struct state *to)
> @@ -833,7 +837,8 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
>  				/* member of a container */
>  				to = to->parent;
>  
> -			min_size = min_spare_size_required(to);
> +			if (get_min_spare_size_required(to, &min_size))
> +				continue;
>  			if (to->metadata->ss->external) {
>  				/* We must make sure there is
>  				 * no suitable spare in container already.


      reply	other threads:[~2011-01-12  5:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11 13:09 [PATCH] Monitor: skip array if error getting size Czarnowska, Anna
2011-01-12  5:18 ` 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=20110112161842.22744002@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).