* [PATCH 0/3] Series short description @ 2011-09-19 16:52 Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container Lukasz Orlowski ` (2 more replies) 0 siblings, 3 replies; 10+ messages in thread From: Lukasz Orlowski @ 2011-09-19 16:52 UTC (permalink / raw) To: neilb; +Cc: linux-raid The following series implements... --- Lukasz Orlowski (3): Create: Allow to create two volumes of different sizes within one container Create: Unnecessary prompt about device being busy Create: Incorrect message when creating a volume with explicit md dev name Create.c | 26 +++++++++++++++----------- super-intel.c | 16 +++++++++++++--- 2 files changed, 28 insertions(+), 14 deletions(-) -- Signature --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. z siedziba w Gdansku ul. Slowackiego 173 80-298 Gdansk Sad Rejonowy Gdansk Polnoc w Gdansku, VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, numer KRS 101882 NIP 957-07-52-316 Kapital zakladowy 200.000 zl This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container 2011-09-19 16:52 [PATCH 0/3] Series short description Lukasz Orlowski @ 2011-09-19 16:52 ` Lukasz Orlowski 2011-09-21 3:31 ` NeilBrown 2011-09-19 16:52 ` [PATCH 2/3] Create: Unnecessary prompt about device being busy Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name Lukasz Orlowski 2 siblings, 1 reply; 10+ messages in thread From: Lukasz Orlowski @ 2011-09-19 16:52 UTC (permalink / raw) To: neilb; +Cc: linux-raid Allows to create RAID 5 volume on 3 disks and then RAID 1 volume on 2 disks withing the same container. Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> --- super-intel.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/super-intel.c b/super-intel.c index a78d723..616853b 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5041,6 +5041,12 @@ 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"); --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. z siedziba w Gdansku ul. Slowackiego 173 80-298 Gdansk Sad Rejonowy Gdansk Polnoc w Gdansku, VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, numer KRS 101882 NIP 957-07-52-316 Kapital zakladowy 200.000 zl This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container 2011-09-19 16:52 ` [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container Lukasz Orlowski @ 2011-09-21 3:31 ` NeilBrown 2011-09-21 6:31 ` Dan Williams 0 siblings, 1 reply; 10+ messages in thread From: NeilBrown @ 2011-09-21 3:31 UTC (permalink / raw) To: Lukasz Orlowski; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 1858 bytes --] On Mon, 19 Sep 2011 18:52:31 +0200 Lukasz Orlowski <lukasz.orlowski@intel.com> wrote: > Allows to create RAID 5 volume on 3 disks and then RAID 1 volume on 2 > disks withing the same container. > > Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> > --- > super-intel.c | 6 ++++++ > 1 files changed, 6 insertions(+), 0 deletions(-) > > diff --git a/super-intel.c b/super-intel.c > index a78d723..616853b 100644 > --- a/super-intel.c > +++ b/super-intel.c > @@ -5041,6 +5041,12 @@ 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"); > This patch doesn't make sense. Firstly the description seems backwards. The purpose of this patch seems to disallow the creation of two volumes with different numbers of devices, but the description seems to say that it allows it. But that is a small point. ->num_disks is the number of devices in the container including spares. This patch would allow the first array in a container to have fewer devices than the container with the rest being spares. However the second array would have to have the same number of devices as the container - even if this is more than the first array. Presumably what you really want to do is: if num_raid_devs > 0, then find the relevant imsm_map, and then check if map->num_members == raiddisks and fail if they are not equal. ?? NeilBrown [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container 2011-09-21 3:31 ` NeilBrown @ 2011-09-21 6:31 ` Dan Williams 2011-09-21 6:55 ` NeilBrown 0 siblings, 1 reply; 10+ messages in thread From: Dan Williams @ 2011-09-21 6:31 UTC (permalink / raw) To: NeilBrown; +Cc: Lukasz Orlowski, linux-raid [-- Attachment #1: Type: text/plain, Size: 2266 bytes --] On Tue, Sep 20, 2011 at 8:31 PM, NeilBrown <neilb@suse.de> wrote: > On Mon, 19 Sep 2011 18:52:31 +0200 Lukasz Orlowski > <lukasz.orlowski@intel.com> wrote: > >> Allows to create RAID 5 volume on 3 disks and then RAID 1 volume on 2 >> disks withing the same container. >> >> Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> >> --- >> super-intel.c | 6 ++++++ >> 1 files changed, 6 insertions(+), 0 deletions(-) >> >> diff --git a/super-intel.c b/super-intel.c >> index a78d723..616853b 100644 >> --- a/super-intel.c >> +++ b/super-intel.c >> @@ -5041,6 +5041,12 @@ 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"); >> > > This patch doesn't make sense. > > Firstly the description seems backwards. The purpose of this patch seems to > disallow the creation of two volumes with different numbers of devices, but > the description seems to say that it allows it. But that is a small point. > > ->num_disks is the number of devices in the container including spares. This > patch would allow the first array in a container to have fewer devices than > the container with the rest being spares. However the second array would have > to have the same number of devices as the container - even if this is more > than the first array. > > Presumably what you really want to do is: > if num_raid_devs > 0, then find the relevant imsm_map, and then check if > map->num_members == raiddisks > and fail if they are not equal. > Yeah, the changelog is backwards, and this breaks tests/08imsm-overlap because it does not honor IMSM_NO_PLATFORM. How about the attached? Lukasz, please copy me on patch submissions. Thanks, Dan [-- Attachment #2: fix-member-disks.patch --] [-- Type: application/octet-stream, Size: 1832 bytes --] imsm: fix array membership enforcement From: Dan Williams <dan.j.williams@intel.com> Commit e7cb06c8 "Create: Allow to create two volumes of different sizes within one container" fixed enforcement of the "all member disks must be a member of all arrays" constraint by adding support for the case where a smaller array is being created in a container with a larger array. However, it broke tests/08imsm-overlap, and the test should be moved next to the existing code that prevents new spares from being activated prematurely. Cc: Lukasz Orlowski <lukasz.orlowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> --- super-intel.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) 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 */ ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container 2011-09-21 6:31 ` Dan Williams @ 2011-09-21 6:55 ` NeilBrown 2011-12-14 18:15 ` Dan Williams 0 siblings, 1 reply; 10+ messages in thread From: NeilBrown @ 2011-09-21 6:55 UTC (permalink / raw) To: Dan Williams; +Cc: Lukasz Orlowski, linux-raid [-- Attachment #1: Type: text/plain, Size: 2814 bytes --] On Tue, 20 Sep 2011 23:31:03 -0700 Dan Williams <dan.j.williams@intel.com> wrote: > On Tue, Sep 20, 2011 at 8:31 PM, NeilBrown <neilb@suse.de> wrote: > > On Mon, 19 Sep 2011 18:52:31 +0200 Lukasz Orlowski > > <lukasz.orlowski@intel.com> wrote: > > > >> Allows to create RAID 5 volume on 3 disks and then RAID 1 volume on 2 > >> disks withing the same container. > >> > >> Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> > >> --- > >> super-intel.c | 6 ++++++ > >> 1 files changed, 6 insertions(+), 0 deletions(-) > >> > >> diff --git a/super-intel.c b/super-intel.c > >> index a78d723..616853b 100644 > >> --- a/super-intel.c > >> +++ b/super-intel.c > >> @@ -5041,6 +5041,12 @@ 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"); > >> > > > > This patch doesn't make sense. > > > > Firstly the description seems backwards. The purpose of this patch seems to > > disallow the creation of two volumes with different numbers of devices, but > > the description seems to say that it allows it. But that is a small point. > > > > ->num_disks is the number of devices in the container including spares. This > > patch would allow the first array in a container to have fewer devices than > > the container with the rest being spares. However the second array would have > > to have the same number of devices as the container - even if this is more > > than the first array. > > > > Presumably what you really want to do is: > > if num_raid_devs > 0, then find the relevant imsm_map, and then check if > > map->num_members == raiddisks > > and fail if they are not equal. > > > > Yeah, the changelog is backwards, and this breaks tests/08imsm-overlap > because it does not honor IMSM_NO_PLATFORM. How about the attached? Better (though text/plain attachments are preferred over application/octet-stream....) However there still seems to be confusion over num_disks versus num_members. You compare num_disks to raiddisks but my understanding is that num_disks can include spares while raiddisks definitely doesn't. Am I confused or are you? NeilBrown > > Lukasz, please copy me on patch submissions. > > Thanks, > Dan [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container 2011-09-21 6:55 ` NeilBrown @ 2011-12-14 18:15 ` Dan Williams 0 siblings, 0 replies; 10+ messages in thread From: Dan Williams @ 2011-12-14 18:15 UTC (permalink / raw) To: NeilBrown; +Cc: Lukasz Orlowski, linux-raid, Kwolek, Adam [ reviving old thread given the recent patch from Adam [1]] On Tue, Sep 20, 2011 at 11:55 PM, NeilBrown <neilb@suse.de> wrote: >> Yeah, the changelog is backwards, and this breaks tests/08imsm-overlap >> because it does not honor IMSM_NO_PLATFORM. How about the attached? > > Better (though text/plain attachments are preferred over > application/octet-stream....) Yeah, gmail picked that unfortunately... need to get my evolution setup going again. > However there still seems to be confusion over num_disks versus num_members. > > You compare num_disks to raiddisks but my understanding is that num_disks can > include spares while raiddisks definitely doesn't. Am I confused or are you? Unfortunately the metadata has no knowledge of how many spares there should be. num_disks is always the current container membership as and spare disks have a metadata record with num_disks == 1. [1]: http://marc.info/?l=linux-raid&m=132387896006974&w=2 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/3] Create: Unnecessary prompt about device being busy 2011-09-19 16:52 [PATCH 0/3] Series short description Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container Lukasz Orlowski @ 2011-09-19 16:52 ` Lukasz Orlowski 2011-09-21 3:36 ` NeilBrown 2011-09-19 16:52 ` [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name Lukasz Orlowski 2 siblings, 1 reply; 10+ messages in thread From: Lukasz Orlowski @ 2011-09-19 16:52 UTC (permalink / raw) To: neilb; +Cc: linux-raid Should the geometry validation fail, mdadm exits with error code 2 if the style of metadata is not explicitly set to imsm. Prior to that however it attempts to exclusively open a device block file. If it succeeds it says that the device is not suitable for any kind of array, otherwise it just says that the device is busy. The file opened is not closed afterwards. Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> --- Create.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Create.c b/Create.c index 8d88aa1..47e5fc8 100644 --- a/Create.c +++ b/Create.c @@ -346,15 +346,15 @@ int Create(struct supertype *st, char *mddev, if (!st) { int dfd = open(dname, O_RDONLY|O_EXCL); - if (dfd < 0) { - fprintf(stderr, Name ": cannot open %s: %s\n", - dname, strerror(errno)); - exit(2); + if (dfd >= 0) { + fprintf(stderr, + Name ": device %s not suitable" + " for any style of array\n", + dname); + close(dfd); } - fprintf(stderr, Name ": device %s not suitable " - "for any style of array\n", - dname); - exit(2); + fail = 1; + break; } if (st->ss != &super0 || st->minor_version != 90) @@ -443,7 +443,7 @@ int Create(struct supertype *st, char *mddev, close(fd); } } - if (raiddisks + sparedisks > st->max_devs) { + if (st && raiddisks + sparedisks > st->max_devs) { fprintf(stderr, Name ": Too many devices:" " %s metadata only supports %d\n", st->ss->name, st->max_devs); --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. z siedziba w Gdansku ul. Slowackiego 173 80-298 Gdansk Sad Rejonowy Gdansk Polnoc w Gdansku, VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, numer KRS 101882 NIP 957-07-52-316 Kapital zakladowy 200.000 zl This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] Create: Unnecessary prompt about device being busy 2011-09-19 16:52 ` [PATCH 2/3] Create: Unnecessary prompt about device being busy Lukasz Orlowski @ 2011-09-21 3:36 ` NeilBrown 0 siblings, 0 replies; 10+ messages in thread From: NeilBrown @ 2011-09-21 3:36 UTC (permalink / raw) To: Lukasz Orlowski; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 2824 bytes --] On Mon, 19 Sep 2011 18:52:38 +0200 Lukasz Orlowski <lukasz.orlowski@intel.com> wrote: > Should the geometry validation fail, mdadm exits with error code 2 if the > style of metadata is not explicitly set to imsm. Prior to that however it > attempts to exclusively open a device block file. If it succeeds it says > that the device is not suitable for any kind of array, otherwise it just > says that the device is busy. The file opened is not closed afterwards. > > Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> I'm confused. What exactly is the problem here? If geometry validation fails, we need to exit because there is nothing useful we can do. We simply check if the problem is that the device is already in use, or if it is an unusable device and report that. Then exit. Seeing we are about the exit there is point closing the file. What is the scenario when you get incorrect behaviour? NeilBrown > --- > Create.c | 18 +++++++++--------- > 1 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/Create.c b/Create.c > index 8d88aa1..47e5fc8 100644 > --- a/Create.c > +++ b/Create.c > @@ -346,15 +346,15 @@ int Create(struct supertype *st, char *mddev, > > if (!st) { > int dfd = open(dname, O_RDONLY|O_EXCL); > - if (dfd < 0) { > - fprintf(stderr, Name ": cannot open %s: %s\n", > - dname, strerror(errno)); > - exit(2); > + if (dfd >= 0) { > + fprintf(stderr, > + Name ": device %s not suitable" > + " for any style of array\n", > + dname); > + close(dfd); > } > - fprintf(stderr, Name ": device %s not suitable " > - "for any style of array\n", > - dname); > - exit(2); > + fail = 1; > + break; > } > if (st->ss != &super0 || > st->minor_version != 90) > @@ -443,7 +443,7 @@ int Create(struct supertype *st, char *mddev, > close(fd); > } > } > - if (raiddisks + sparedisks > st->max_devs) { > + if (st && raiddisks + sparedisks > st->max_devs) { > fprintf(stderr, Name ": Too many devices:" > " %s metadata only supports %d\n", > st->ss->name, st->max_devs); > > --------------------------------------------------------------------- > Intel Technology Poland sp. z o.o. > z siedziba w Gdansku > ul. Slowackiego 173 > 80-298 Gdansk > > Sad Rejonowy Gdansk Polnoc w Gdansku, > VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, > numer KRS 101882 > > NIP 957-07-52-316 > Kapital zakladowy 200.000 zl > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name 2011-09-19 16:52 [PATCH 0/3] Series short description Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 2/3] Create: Unnecessary prompt about device being busy Lukasz Orlowski @ 2011-09-19 16:52 ` Lukasz Orlowski 2011-09-21 3:48 ` NeilBrown 2 siblings, 1 reply; 10+ messages in thread From: Lukasz Orlowski @ 2011-09-19 16:52 UTC (permalink / raw) To: neilb; +Cc: linux-raid Appears when one attempts to create RAID 1 volume on 2 disks within a container with an existing RAID 5 volume on 3 disks and specifies the md device explicitly (e.g. /dev/md127). Instead of saying that such volume cannot be created it says that the devices have insufficient size. Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> --- Create.c | 8 ++++++-- super-intel.c | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Create.c b/Create.c index 47e5fc8..baadd9f 100644 --- a/Create.c +++ b/Create.c @@ -262,9 +262,13 @@ int Create(struct supertype *st, char *mddev, if (size && chunk && chunk != UnSet) size &= ~(unsigned long long)(chunk - 1); newsize = size * 2; - if (st && ! st->ss->validate_geometry(st, level, layout, raiddisks, - &chunk, size*2, NULL, &newsize, verbose>=0)) + if (st && ! + st->ss->validate_geometry( + st, level, layout, raiddisks, &chunk, + size*2, NULL, &newsize, verbose >= 0)) { + fprintf(stderr, Name ": create aborted.\n"); return 1; + } if (chunk && chunk != UnSet) { newsize &= ~(unsigned long long)(chunk*2 - 1); diff --git a/super-intel.c b/super-intel.c index 616853b..51874ae 100644 --- a/super-intel.c +++ b/super-intel.c @@ -5223,9 +5223,13 @@ static int reserve_space(struct supertype *st, int raiddisks, /* chunk is in K */ minsize = chunk * 2; - if (cnt < raiddisks || - (super->orom && used && used != raiddisks) || - maxsize < minsize || + if (cnt < raiddisks || (super->orom && used && used != raiddisks)) { + fprintf(stderr, Name ": the option-rom requires all " + "member disks to be a member of all volumes.\n"); + return 0; + } + + if (maxsize < minsize || maxsize == 0) { fprintf(stderr, Name ": not enough devices with space to create array.\n"); return 0; /* No enough free spaces large enough */ --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. z siedziba w Gdansku ul. Slowackiego 173 80-298 Gdansk Sad Rejonowy Gdansk Polnoc w Gdansku, VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, numer KRS 101882 NIP 957-07-52-316 Kapital zakladowy 200.000 zl This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name 2011-09-19 16:52 ` [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name Lukasz Orlowski @ 2011-09-21 3:48 ` NeilBrown 0 siblings, 0 replies; 10+ messages in thread From: NeilBrown @ 2011-09-21 3:48 UTC (permalink / raw) To: Lukasz Orlowski; +Cc: linux-raid [-- Attachment #1: Type: text/plain, Size: 3003 bytes --] On Mon, 19 Sep 2011 18:52:45 +0200 Lukasz Orlowski <lukasz.orlowski@intel.com> wrote: > Appears when one attempts to create RAID 1 volume on 2 disks within a > container with an existing RAID 5 volume on 3 disks and specifies the > md device explicitly (e.g. /dev/md127). Instead of saying that such volume > cannot be created it says that the devices have insufficient size. I cannot reproduce this and I don't really understand what problem you are trying to solve (seems to be happening a lot today :-( ) Could you give me a simple list of commands that produce undesirable results? Thanks, NeilBrown > > Signed-off-by: Lukasz Orlowski <lukasz.orlowski@intel.com> > --- > Create.c | 8 ++++++-- > super-intel.c | 10 +++++++--- > 2 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/Create.c b/Create.c > index 47e5fc8..baadd9f 100644 > --- a/Create.c > +++ b/Create.c > @@ -262,9 +262,13 @@ int Create(struct supertype *st, char *mddev, > if (size && chunk && chunk != UnSet) > size &= ~(unsigned long long)(chunk - 1); > newsize = size * 2; > - if (st && ! st->ss->validate_geometry(st, level, layout, raiddisks, > - &chunk, size*2, NULL, &newsize, verbose>=0)) > + if (st && ! > + st->ss->validate_geometry( > + st, level, layout, raiddisks, &chunk, > + size*2, NULL, &newsize, verbose >= 0)) { > + fprintf(stderr, Name ": create aborted.\n"); > return 1; > + } > > if (chunk && chunk != UnSet) { > newsize &= ~(unsigned long long)(chunk*2 - 1); > diff --git a/super-intel.c b/super-intel.c > index 616853b..51874ae 100644 > --- a/super-intel.c > +++ b/super-intel.c > @@ -5223,9 +5223,13 @@ static int reserve_space(struct supertype *st, int raiddisks, > /* chunk is in K */ > minsize = chunk * 2; > > - if (cnt < raiddisks || > - (super->orom && used && used != raiddisks) || > - maxsize < minsize || > + if (cnt < raiddisks || (super->orom && used && used != raiddisks)) { > + fprintf(stderr, Name ": the option-rom requires all " > + "member disks to be a member of all volumes.\n"); > + return 0; > + } > + > + if (maxsize < minsize || > maxsize == 0) { > fprintf(stderr, Name ": not enough devices with space to create array.\n"); > return 0; /* No enough free spaces large enough */ > > --------------------------------------------------------------------- > Intel Technology Poland sp. z o.o. > z siedziba w Gdansku > ul. Slowackiego 173 > 80-298 Gdansk > > Sad Rejonowy Gdansk Polnoc w Gdansku, > VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, > numer KRS 101882 > > NIP 957-07-52-316 > Kapital zakladowy 200.000 zl > > This e-mail and any attachments may contain confidential material for > the sole use of the intended recipient(s). Any review or distribution > by others is strictly prohibited. If you are not the intended > recipient, please contact the sender and delete all copies. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-12-14 18:15 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-09-19 16:52 [PATCH 0/3] Series short description Lukasz Orlowski 2011-09-19 16:52 ` [PATCH 1/3] Create: Allow to create two volumes of different sizes within one container Lukasz Orlowski 2011-09-21 3:31 ` NeilBrown 2011-09-21 6:31 ` Dan Williams 2011-09-21 6:55 ` NeilBrown 2011-12-14 18:15 ` Dan Williams 2011-09-19 16:52 ` [PATCH 2/3] Create: Unnecessary prompt about device being busy Lukasz Orlowski 2011-09-21 3:36 ` NeilBrown 2011-09-19 16:52 ` [PATCH 3/3] Create: Incorrect message when creating a volume with explicit md dev name Lukasz Orlowski 2011-09-21 3:48 ` NeilBrown
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).