linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Labun, Marcin" <Marcin.Labun@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: [PATCH] imsm: platform capabilities are not validated during level migration
Date: Thu, 17 Nov 2011 12:02:58 +1100	[thread overview]
Message-ID: <20111117120258.0bb75d47@notabene.brown> (raw)
In-Reply-To: <F9123E44003394499FDD2B17C60621D405E476@IRSMSX101.ger.corp.intel.com>

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

On Tue, 15 Nov 2011 13:49:36 +0000 "Labun, Marcin" <Marcin.Labun@intel.com>
wrote:

> Subject: [PATCH] imsm: platform capabilities are not validated during level migration
> 
> Migration from RAID0 to RAID5 should be blocked on the system without
> support for RAID5. No platform validation was performed in RAID
> level migrations: verification for all level migrations added.
> 
> Signed-off-by: Marcin Labun <marcin.labun@intel.com>

Applied, thanks.

NeilBrown


> ---
>  super-intel.c |   35 +++++++++++++++++++----------------
>  1 files changed, 19 insertions(+), 16 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index f776be9..b64aa7a 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5385,7 +5385,11 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
>  	}
>  	
>  	if (!dev) {
> -		if (st->sb && freesize) {
> +		if (st->sb) {
> +			if (!validate_geometry_imsm_orom(st->sb, level, layout,
> +							 raiddisks, chunk,
> +							 verbose))
> +				return 0;
>  			/* we are being asked to automatically layout a
>  			 * new volume based on the current contents of
>  			 * the container.  If the the parameters can be
> @@ -5394,12 +5398,9 @@ static int validate_geometry_imsm(struct supertype *st, int level, int layout,
>  			 * created.  add_to_super and getinfo_super
>  			 * detect when autolayout is in progress.
>  			 */
> -			if (!validate_geometry_imsm_orom(st->sb, level, layout,
> -							 raiddisks, chunk,
> -							 verbose))
> -				return 0;
> -			return reserve_space(st, raiddisks, size,
> -					     chunk?*chunk:0, freesize);
> +			if (freesize)
> +				return reserve_space(st, raiddisks, size,
> +						     chunk?*chunk:0, freesize);
>  		}
>  		return 1;
>  	}
> @@ -8664,6 +8665,8 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
>  	int change = -1;
>  	int check_devs = 0;
>  	int chunk;
> +	int devNumChange=0;
> +	int layout = -1;
>  
>  	getinfo_super_imsm_volume(st, &info, NULL);
>  	if ((geo->level != info.array.level) &&
> @@ -8681,23 +8684,23 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
>  					change = -1;
>  					goto analyse_change_exit;
>  				}
> +				layout =  geo->layout;
>  				check_devs = 1;
> -			}
> -			if (geo->level == 10) {
> +				devNumChange = 1; /* parity disk added */
> +			} else if (geo->level == 10) {
>  				change = CH_TAKEOVER;
>  				check_devs = 1;
> +				devNumChange = 2; /* two mirrors added */
> +				layout = 0x102; /* imsm supported layout */
>  			}
>  			break;
>  		case 1:
> -			if (geo->level == 0) {
> -				change = CH_TAKEOVER;
> -				check_devs = 1;
> -			}
> -			break;
>  		case 10:
>  			if (geo->level == 0) {
>  				change = CH_TAKEOVER;
>  				check_devs = 1;
> +				devNumChange = -(geo->raid_disks/2);
> +				layout = 0; /* imsm raid0 layout */ 
>  			}
>  			break;
>  		}
> @@ -8744,8 +8747,8 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
>  	chunk = geo->chunksize / 1024;
>  	if (!validate_geometry_imsm(st,
>  				    geo->level,
> -				    geo->layout,
> -				    geo->raid_disks,
> +				    layout,
> +				    geo->raid_disks + devNumChange,
>  				    &chunk,
>  				    geo->size,
>  				    0, 0, 1))


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

      reply	other threads:[~2011-11-17  1:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 13:49 [PATCH] imsm: platform capabilities are not validated during level migration Labun, Marcin
2011-11-17  1:02 ` 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=20111117120258.0bb75d47@notabene.brown \
    --to=neilb@suse.de \
    --cc=Marcin.Labun@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).