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, ed.ciechanowski@intel.com,
	marcin.labun@intel.com, dan.j.williams@intel.com
Subject: Re: [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation during reshape
Date: Mon, 3 Oct 2011 10:31:16 +1100	[thread overview]
Message-ID: <20111003103116.47d4ccf5@notabene.brown> (raw)
In-Reply-To: <20110929154536.22094.87434.stgit@gklab-128-013.igk.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2439 bytes --]

On Thu, 29 Sep 2011 17:45:36 +0200 Adam Kwolek <adam.kwolek@intel.com> wrote:

> Spare disk activation or starting repair for one array while on second
> reshape is in progress, will lead to IMSM incompatible situation when
> 2 arrays in container shares different disks sets.
> This can cause that 2 processes in container /reshape and rebuild/
> are in progress in parallel. This is IMSM incompatible situation also.
> 
> Block spare disk activation and starting resync if any reshape in container
> is in progress.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>

Thanks - applied.

(though I changed the while loop into a for loop... I couldn't help myself ;-)

NeilBrown


> ---
> 
>  super-intel.c |   33 +++++++++++++++++++++++++++++----
>  1 files changed, 29 insertions(+), 4 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 07d47b5..5504c17 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -2237,6 +2237,33 @@ static int write_imsm_migr_rec(struct supertype *st)
>  }
>  #endif /* MDASSEMBLE */
>  
> +/* spare/missing disks activations are not allowe when
> + * array/container performs reshape operation, because
> + * all arrays in container works on the same disks set
> + */
> +int imsm_reshape_blocks_arrays_changes(struct intel_super *super)
> +{
> +	int rv = 0;
> +	struct intel_dev *i_dev = super->devlist;
> +	struct imsm_dev *dev;
> +
> +	/* check whole container
> +	 */
> +	while (i_dev) {
> +		dev = i_dev->dev;
> +		if (dev->vol.migr_state &&
> +		    dev->vol.migr_type == MIGR_GEN_MIGR) {
> +			/* No repair during any migration in container
> +			 */
> +			rv = 1;
> +			break;
> +		}
> +		i_dev = i_dev->next;
> +	}
> +
> +	return rv;
> +}
> +
>  static void getinfo_super_imsm_volume(struct supertype *st, struct mdinfo *info, char *dmap)
>  {
>  	struct intel_super *super = st->sb;
> @@ -6592,10 +6619,8 @@ static struct mdinfo *imsm_activate_spare(struct active_array *a,
>  	dprintf("imsm: activate spare: inst=%d failed=%d (%d) level=%d\n",
>  		inst, failed, a->info.array.raid_disks, a->info.array.level);
>  
> -	if (dev->vol.migr_state &&
> -	    dev->vol.migr_type == MIGR_GEN_MIGR)
> -		/* No repair during migration */
> -		return NULL;
> +	if (imsm_reshape_blocks_arrays_changes(super))
> +			return NULL;
>  
>  	if (a->info.array.level == 4)
>  		/* No repair for takeovered array


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

  reply	other threads:[~2011-10-02 23:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 15:45 [PATCH 0/2] Do not allow for resync during reshape Adam Kwolek
2011-09-29 15:45 ` [PATCH 1/2] imsm: FIX: Do not allow for spare disk activation " Adam Kwolek
2011-10-02 23:31   ` NeilBrown [this message]
2011-09-29 15:45 ` [PATCH 2/2] imsm: Do not mark resync " Adam Kwolek
2011-10-02 23:31   ` 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=20111003103116.47d4ccf5@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=marcin.labun@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).