* [PATCH 1/2] dm-raid: Fix minimal device check @ 2015-10-28 18:50 Andy Grover 2015-10-28 18:50 ` [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 Andy Grover 2015-10-28 19:39 ` [PATCH 1/2] dm-raid: Fix minimal device check Heinz Mauelshagen 0 siblings, 2 replies; 5+ messages in thread From: Andy Grover @ 2015-10-28 18:50 UTC (permalink / raw) To: dm-devel Check raid_type->minimal_devs instead of parity_devs. minimal_devs is used nowhere else (and makes sense to use here) so I think this is what was intended. Signed-off-by: Andy Grover <agrover@redhat.com> --- drivers/md/dm-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index a090121..5941cfd 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -151,7 +151,7 @@ static struct raid_set *context_alloc(struct dm_target *ti, struct raid_type *ra unsigned i; struct raid_set *rs; - if (raid_devs <= raid_type->parity_devs) { + if (raid_devs < raid_type->minimal_devs) { ti->error = "Insufficient number of devices"; return ERR_PTR(-EINVAL); } -- 2.4.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 2015-10-28 18:50 [PATCH 1/2] dm-raid: Fix minimal device check Andy Grover @ 2015-10-28 18:50 ` Andy Grover 2015-10-28 19:17 ` Heinz Mauelshagen 2015-10-28 19:39 ` [PATCH 1/2] dm-raid: Fix minimal device check Heinz Mauelshagen 1 sibling, 1 reply; 5+ messages in thread From: Andy Grover @ 2015-10-28 18:50 UTC (permalink / raw) To: dm-devel A raid6 device can be created from 3 devs. This previously didn't cause an error because minimal_devs was not being checked. Signed-off-by: Andy Grover <agrover@redhat.com> --- drivers/md/dm-raid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 5941cfd..1ded052 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -90,9 +90,9 @@ static struct raid_type { {"raid5_ra", "RAID5 (right asymmetric)", 1, 2, 5, ALGORITHM_RIGHT_ASYMMETRIC}, {"raid5_ls", "RAID5 (left symmetric)", 1, 2, 5, ALGORITHM_LEFT_SYMMETRIC}, {"raid5_rs", "RAID5 (right symmetric)", 1, 2, 5, ALGORITHM_RIGHT_SYMMETRIC}, - {"raid6_zr", "RAID6 (zero restart)", 2, 4, 6, ALGORITHM_ROTATING_ZERO_RESTART}, - {"raid6_nr", "RAID6 (N restart)", 2, 4, 6, ALGORITHM_ROTATING_N_RESTART}, - {"raid6_nc", "RAID6 (N continue)", 2, 4, 6, ALGORITHM_ROTATING_N_CONTINUE} + {"raid6_zr", "RAID6 (zero restart)", 2, 3, 6, ALGORITHM_ROTATING_ZERO_RESTART}, + {"raid6_nr", "RAID6 (N restart)", 2, 3, 6, ALGORITHM_ROTATING_N_RESTART}, + {"raid6_nc", "RAID6 (N continue)", 2, 3, 6, ALGORITHM_ROTATING_N_CONTINUE} }; static char *raid10_md_layout_to_format(int layout) -- 2.4.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 2015-10-28 18:50 ` [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 Andy Grover @ 2015-10-28 19:17 ` Heinz Mauelshagen 0 siblings, 0 replies; 5+ messages in thread From: Heinz Mauelshagen @ 2015-10-28 19:17 UTC (permalink / raw) To: device-mapper development NACK 4 devs is actually the mandatory minimum for raid6; minimum of 2 data stripes plus 2 devices for parity and q-syndrome. FWIW: the 2 devices minimum for the raid4/5 layouts are correct too, because those personalities are able to drive 2 devices as raid1 (i.e. allow for takeover from raid1 with 2 legs) in order to reshape them to 'real' raid4/5 by adding N>0 devices Heinz On 10/28/2015 07:50 PM, Andy Grover wrote: > A raid6 device can be created from 3 devs. This previously didn't cause > an error because minimal_devs was not being checked. > > Signed-off-by: Andy Grover <agrover@redhat.com> > --- > drivers/md/dm-raid.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c > index 5941cfd..1ded052 100644 > --- a/drivers/md/dm-raid.c > +++ b/drivers/md/dm-raid.c > @@ -90,9 +90,9 @@ static struct raid_type { > {"raid5_ra", "RAID5 (right asymmetric)", 1, 2, 5, ALGORITHM_RIGHT_ASYMMETRIC}, > {"raid5_ls", "RAID5 (left symmetric)", 1, 2, 5, ALGORITHM_LEFT_SYMMETRIC}, > {"raid5_rs", "RAID5 (right symmetric)", 1, 2, 5, ALGORITHM_RIGHT_SYMMETRIC}, > - {"raid6_zr", "RAID6 (zero restart)", 2, 4, 6, ALGORITHM_ROTATING_ZERO_RESTART}, > - {"raid6_nr", "RAID6 (N restart)", 2, 4, 6, ALGORITHM_ROTATING_N_RESTART}, > - {"raid6_nc", "RAID6 (N continue)", 2, 4, 6, ALGORITHM_ROTATING_N_CONTINUE} > + {"raid6_zr", "RAID6 (zero restart)", 2, 3, 6, ALGORITHM_ROTATING_ZERO_RESTART}, > + {"raid6_nr", "RAID6 (N restart)", 2, 3, 6, ALGORITHM_ROTATING_N_RESTART}, > + {"raid6_nc", "RAID6 (N continue)", 2, 3, 6, ALGORITHM_ROTATING_N_CONTINUE} > }; > > static char *raid10_md_layout_to_format(int layout) ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dm-raid: Fix minimal device check 2015-10-28 18:50 [PATCH 1/2] dm-raid: Fix minimal device check Andy Grover 2015-10-28 18:50 ` [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 Andy Grover @ 2015-10-28 19:39 ` Heinz Mauelshagen 2015-10-28 22:16 ` Andy Grover 1 sibling, 1 reply; 5+ messages in thread From: Heinz Mauelshagen @ 2015-10-28 19:39 UTC (permalink / raw) To: dm-devel NACK md can drive a single disk raid5. On 10/28/2015 07:50 PM, Andy Grover wrote: > Check raid_type->minimal_devs instead of parity_devs. minimal_devs is used > nowhere else (and makes sense to use here) so I think this is what was > intended. > > Signed-off-by: Andy Grover <agrover@redhat.com> > --- > drivers/md/dm-raid.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c > index a090121..5941cfd 100644 > --- a/drivers/md/dm-raid.c > +++ b/drivers/md/dm-raid.c > @@ -151,7 +151,7 @@ static struct raid_set *context_alloc(struct dm_target *ti, struct raid_type *ra > unsigned i; > struct raid_set *rs; > > - if (raid_devs <= raid_type->parity_devs) { > + if (raid_devs < raid_type->minimal_devs) { > ti->error = "Insufficient number of devices"; > return ERR_PTR(-EINVAL); > } ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] dm-raid: Fix minimal device check 2015-10-28 19:39 ` [PATCH 1/2] dm-raid: Fix minimal device check Heinz Mauelshagen @ 2015-10-28 22:16 ` Andy Grover 0 siblings, 0 replies; 5+ messages in thread From: Andy Grover @ 2015-10-28 22:16 UTC (permalink / raw) To: device-mapper development On 10/28/2015 12:39 PM, Heinz Mauelshagen wrote: > > NACK > > md can drive a single disk raid5. Ok thanks. Please withdraw these two patches. -- Andy ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-10-28 22:16 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-28 18:50 [PATCH 1/2] dm-raid: Fix minimal device check Andy Grover 2015-10-28 18:50 ` [PATCH 2/2] dm-raid: Fix minimal_devs for raid6 Andy Grover 2015-10-28 19:17 ` Heinz Mauelshagen 2015-10-28 19:39 ` [PATCH 1/2] dm-raid: Fix minimal device check Heinz Mauelshagen 2015-10-28 22:16 ` Andy Grover
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.