linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
	ed.ciechanowski@intel.com, wojciech.neubauer@intel.com
Subject: Re: [PATCH] FIX: Do not count as backup devices, spare disks used for reshape
Date: Sun, 20 Mar 2011 15:41:11 +1100	[thread overview]
Message-ID: <20110320154111.23c9e350@notabene.brown> (raw)
In-Reply-To: <20110318105511.6462.93752.stgit@gklab-128-013.igk.intel.com>

On Fri, 18 Mar 2011 11:55:12 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Problem:
> Reshape is run without specified backup file when all spares are used for expansion.
> 
> When spare disks are used for reshape, they should not be counted as backup devices.
> Md still thinks about them as about spares until reshape will not be started.
> mdadm should have all it in mind.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  Grow.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/Grow.c b/Grow.c
> index b639585..17c22fc 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -1660,6 +1660,7 @@ static int reshape_array(char *container, int fd, char *devname,
>  	unsigned long long array_size;
>  	int done;
>  	struct mdinfo *sra = NULL;
> +	int used_spares = 0;
>  
>  	/* when reshaping a RAID0, the component_size might be zero.
>  	 * So try to fix that up.
> @@ -1793,6 +1794,7 @@ static int reshape_array(char *container, int fd, char *devname,
>  					 * be part of the array.
>  					 */
>  					add_disk(fd, st, info2, d);
> +					used_spares++;
>  				}
>  			}
>  			sysfs_free(info2);
> @@ -1956,7 +1958,7 @@ started:
>  				Name ": %s: Cannot grow - need backup-file\n", 
>  				devname);
>  			goto release;
> -		} else if (sra->array.spare_disks == 0) {
> +		} else if (sra->array.spare_disks - used_spares == 0) {
>  			fprintf(stderr, Name ": %s: Cannot grow - need a spare or "
>  				"backup-file to backup critical section\n",
>  				devname);


This change doesn't make sense to me.

The only time when we use a spare device as for storing the backup is (or at
least should be) when increasing the number of devices in the array.
In that case we only need a backup at the very beginning.
So we use the end of a spare for the backup that happens at the every
beginning and it all works happily.

Why do you now want to count a spare used for backup as a spare to use for
growth?

NeilBrown

  reply	other threads:[~2011-03-20  4:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18 10:55 [PATCH] FIX: Do not count as backup devices, spare disks used for reshape Adam Kwolek
2011-03-20  4:41 ` NeilBrown [this message]
2011-03-23  7:49   ` Kwolek, Adam
2011-03-23 23:24     ` NeilBrown

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=20110320154111.23c9e350@notabene.brown \
    --to=neilb@suse.de \
    --cc=adam.kwolek@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=wojciech.neubauer@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).