linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Williams, Dan J" <dan.j.williams@intel.com>
Cc: Adam Kwolek <adam.kwolek@intel.com>,
	linux-raid@vger.kernel.org, ed.ciechanowski@intel.com,
	marcin.labun@intel.com
Subject: Re: [PATCH 3/3] imsm: FIX: UT '08imsm-overlap' fails
Date: Thu, 15 Dec 2011 15:03:14 +1100	[thread overview]
Message-ID: <20111215150314.7e5694c7@notabene.brown> (raw)
In-Reply-To: <CABE8wwt44LbrKEGJjoUyjOt5zDP2=uO60hVPYfWpxMHi+EuQwg@mail.gmail.com>

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

On Wed, 14 Dec 2011 10:21:07 -0800 "Williams, Dan J"
<dan.j.williams@intel.com> wrote:

> On Wed, Dec 14, 2011 at 7:07 AM, Adam Kwolek <adam.kwolek@intel.com> wrote:
> > Problem was introduced by patch (2011-09-19):
> >   Create: Allow to create two volumes of different sizes within one container
> >
> > To resolve problem check requested disks number not against all disks
> > recorded in metadata, but against disks number set in array map structure.
> >
> > Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> > ---
> >
> >  super-intel.c |   24 ++++++++++++++++++++----
> >  1 files changed, 20 insertions(+), 4 deletions(-)
> >
> > diff --git a/super-intel.c b/super-intel.c
> > index 5e1d278..3c10d29 100644
> > --- a/super-intel.c
> > +++ b/super-intel.c
> > @@ -5318,10 +5318,26 @@ static int validate_geometry_imsm_volume(struct supertype *st, int level,
> >
> >        mpb = super->anchor;
> >
> > -       if (mpb->num_raid_devs > 0 && mpb->num_disks != raiddisks) {
> > -               fprintf(stderr, Name ": the option-rom requires all "
> > -                       "member disks to be a member of all volumes.\n");
> > -               return 0;
> > +       /* check if currently verified volume spans the same disks number
> > +        * as all other arrays that belongs to metadata.
> > +        * Do not allow to create volume with different disks number
> > +        * than curently is used.
> > +        */
> > +       for (i = 0; i < mpb->num_raid_devs; i++) {
> > +               /* There is any already existing array in metadata
> > +                */
> > +               struct imsm_dev *dev = get_imsm_dev(super, i);
> > +               struct imsm_map *map = NULL;
> > +               if (dev)
> > +                       map = get_imsm_map(dev, MAP_0);
> > +               if (map) {
> > +                       if (raiddisks != map->num_members) {
> > +                               fprintf(stderr, Name ": the option-rom requires"
> > +                                       " all member disks to be a member of "
> > +                                       "all volumes.\n");
> > +                               return 0;
> > +                       }
> > +               }
> 
> I'd prefer to move this check back to the other 'orom' checks in
> validate_geometry_imsm_volume(), and make it dependent on the presence
> of the orom.
> 
> diff --git a/super-intel.c b/super-intel.c
> index 07d47b5..9885b98 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5122,12 +5122,6 @@ static int validate_geometry_imsm_volume(struct
> supertype *st, int level,
>  	if (!super)
>  		return 0;
> 
> -	if (mpb->num_raid_devs > 0 && mpb->num_disks != raiddisks) {
> -		fprintf(stderr, Name ": the option-rom requires all "
> -			"member disks to be a member of all volumes.\n");
> -		return 0;
> -	}
> -
>  	if (!validate_geometry_imsm_orom(super, level, layout, raiddisks,
> chunk, verbose)) {
>  		fprintf(stderr, Name ": RAID gemetry validation failed. "
>  			"Cannot proceed with the action(s).\n");
> @@ -5206,6 +5200,11 @@ static int validate_geometry_imsm_volume(struct
> supertype *st, int level,
>  		fprintf(stderr, Name ": The option-rom requires all member"
>  			" disks to be a member of all volumes\n");
>  		return 0;
> +	} else if (super->orom && mpb->num_raid_devs > 0 &&
> +		   mpb->num_disks != raiddisks) {
> +		fprintf(stderr, Name ": The option-rom requires all member"
> +			" disks to be a member of all volumes\n");
> +		return 0;
>  	}
> 
>  	/* retrieve the largest free space block */


Hi Dan,
 I think you are presenting this as an alternate - is that correct?
It seems a lit simpler - does it do enough?

Or is it just a precursor, and then we apply Adam's patch changing the same
code but in a different location?

Slightly confused...

NeilBrown


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

  reply	other threads:[~2011-12-15  4:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 15:06 [PATCH 0/3] Enable mdadm UT execution for imsm Adam Kwolek
2011-12-14 15:07 ` [PATCH 1/3] imsm: FIX: Chunk size migration is not possible Adam Kwolek
2011-12-15  4:01   ` NeilBrown
2011-12-14 15:07 ` [PATCH 2/3] imsm: FIX: 'UT 09imsm-assemble' fails Adam Kwolek
2011-12-14 16:27   ` Peter W. Morreale
2011-12-15  4:01   ` NeilBrown
2011-12-15 10:28     ` Kwolek, Adam
2011-12-15 11:07       ` NeilBrown
2011-12-15 15:29         ` Kwolek, Adam
2011-12-15 19:30           ` NeilBrown
2011-12-14 15:07 ` [PATCH 3/3] imsm: FIX: UT '08imsm-overlap' fails Adam Kwolek
2011-12-14 18:21   ` Williams, Dan J
2011-12-15  4:03     ` NeilBrown [this message]
     [not found]       ` <CABE8wwvfzxM1e2S7XOotMHWT40JF6sbRH3mW688dpuWmwoCtZQ@mail.gmail.com>
2011-12-15  8:01         ` Kwolek, Adam
2011-12-16  4:18           ` Williams, Dan J
2011-12-16  8:32             ` Kwolek, Adam
2011-12-19 23:38               ` NeilBrown
2011-12-20  8:02                 ` 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=20111215150314.7e5694c7@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).