linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "Kwolek, Adam" <adam.kwolek@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>
Subject: Re: [md PATCH 3/5] md: Use added disks for external metadata case in start_reshape()
Date: Wed, 16 Jun 2010 14:58:18 +1000	[thread overview]
Message-ID: <20100616145818.75bf0720@notabene.brown> (raw)
In-Reply-To: <905EDD02F158D948B186911EB64DB3D11EECE8A3@irsmsx503.ger.corp.intel.com>

On Wed, 9 Jun 2010 15:21:44 +0100
"Kwolek, Adam" <adam.kwolek@intel.com> wrote:

> (md: Online Capacity Expansion for IMSM)
> Disks added by mdadm for external metadata are not taken for configuration check before reshape.
> This causes configuration check fail.
> 
> For reshape, we should check if added disks to volume by mdadm, will satisfy degradation condition after operation (comparing difference of target disk number and available disks number to mddev->max_degraded field).
> ---

I'm sorry but I don't understand what you are saying, and I think the
required check is already in place.
Could you please describe a specific circumstance where the current code
fails?

Thanks,
NeilBrown


> 
>  drivers/md/raid5.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 546e23e..dc25a32 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -5411,6 +5411,7 @@ static int raid5_start_reshape(mddev_t *mddev)
>  	int spares = 0;
>  	int added_devices = 0;
>  	unsigned long flags;
> +	int disk_count = 0;
>  
>  	if (test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))
>  		return -EBUSY;
> @@ -5422,12 +5423,20 @@ static int raid5_start_reshape(mddev_t *mddev)
>  		if (rdev->raid_disk < 0 &&
>  		    !test_bit(Faulty, &rdev->flags))
>  			spares++;
> +		else
> +			/* check reshape condition/spares are added already
> +			 */
> +			disk_count++;
>  
>  	if (spares - mddev->degraded < mddev->delta_disks - conf->max_degraded)
>  		/* Not enough devices even to make a degraded array
>  		 * of that size
> +		 * but check first if this is not reshape case
> +		 * if not reshape on degraded array /takeover/ than exit
>  		 */
> -		return -EINVAL;
> +		if ((conf->raid_disks + mddev->delta_disks)
> +		    > (disk_count + conf->max_degraded))
> +			return -EINVAL;
>  
>  	/* Refuse to reduce size of the array.  Any reductions in
>  	 * array size must be through explicit setting of array_size
> 


  reply	other threads:[~2010-06-16  4:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 14:21 [md PATCH 3/5] md: Use added disks for external metadata case in start_reshape() Kwolek, Adam
2010-06-16  4:58 ` Neil Brown [this message]
2010-06-18  8:35   ` Kwolek, Adam

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=20100616145818.75bf0720@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 \
    /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).