* [PATCH] md: raid5 run(): Fix max_degraded for raid level 4.
@ 2009-03-18 12:53 Andre Noll
2009-03-20 0:09 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Andre Noll @ 2009-03-18 12:53 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid
[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]
Hi Neil,
I found this one while trying to figure out why 3-disk raid6 arrays
aren't supported. It's an obvious and trivial bug fix but probably
not important enough for stable as it only affects raid4.
Regards
Andre
commit ea30abef4d1f3aad635eb24db082f3531b573540
Author: Andre Noll <maan@systemlinux.org>
Date: Wed Mar 18 13:43:08 2009 +0100
md: raid5 run(): Fix max_degraded for raid level 4.
raid4 allows only one failed disk.
Signed-off-by: Andre Noll <maan@systemlinux.org>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index a76ef52..ceb5924 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4484,7 +4484,7 @@ static int run(mddev_t *mddev)
*/
sector_t here_new, here_old;
int old_disks;
- int max_degraded = (mddev->level == 5 ? 1 : 2);
+ int max_degraded = (mddev->level == 6 ? 2 : 1);
if (mddev->new_level != mddev->level ||
mddev->new_layout != mddev->layout ||
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] md: raid5 run(): Fix max_degraded for raid level 4. 2009-03-18 12:53 [PATCH] md: raid5 run(): Fix max_degraded for raid level 4 Andre Noll @ 2009-03-20 0:09 ` Neil Brown 2009-03-20 9:14 ` [PATCH] relax checks to support 3disk raid6 arrays Andre Noll 0 siblings, 1 reply; 5+ messages in thread From: Neil Brown @ 2009-03-20 0:09 UTC (permalink / raw) To: Andre Noll; +Cc: linux-raid On Wednesday March 18, maan@systemlinux.org wrote: > Hi Neil, > > I found this one while trying to figure out why 3-disk raid6 arrays > aren't supported. It's an obvious and trivial bug fix but probably > not important enough for stable as it only affects raid4. > Thanks! Applied. Have you tried a 3-disk raid6 yet? Any conclusions? NeilBrown > Regards > Andre > > commit ea30abef4d1f3aad635eb24db082f3531b573540 > Author: Andre Noll <maan@systemlinux.org> > Date: Wed Mar 18 13:43:08 2009 +0100 > > md: raid5 run(): Fix max_degraded for raid level 4. > > raid4 allows only one failed disk. > > Signed-off-by: Andre Noll <maan@systemlinux.org> > > diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c > index a76ef52..ceb5924 100644 > --- a/drivers/md/raid5.c > +++ b/drivers/md/raid5.c > @@ -4484,7 +4484,7 @@ static int run(mddev_t *mddev) > */ > sector_t here_new, here_old; > int old_disks; > - int max_degraded = (mddev->level == 5 ? 1 : 2); > + int max_degraded = (mddev->level == 6 ? 2 : 1); > > if (mddev->new_level != mddev->level || > mddev->new_layout != mddev->layout || > -- > The only person who always got his work done by Friday was Robinson Crusoe ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] relax checks to support 3disk raid6 arrays 2009-03-20 0:09 ` Neil Brown @ 2009-03-20 9:14 ` Andre Noll 2009-03-20 9:20 ` Peter Rabbitson 0 siblings, 1 reply; 5+ messages in thread From: Andre Noll @ 2009-03-20 9:14 UTC (permalink / raw) To: Neil Brown; +Cc: linux-raid [-- Attachment #1.1: Type: text/plain, Size: 439 bytes --] On 11:09, Neil Brown wrote: > Have you tried a 3-disk raid6 yet? Any conclusions? Yes, I played around a bit and used the two attached patches that relax some checks in the kernel and in mdadm. It appears to work fine, but I did only minimal testing with small loop devices, so I would not recommend it for production use yet :) Regards Andre -- The only person who always got his work done by Friday was Robinson Crusoe [-- Attachment #1.2: 3disk-raid6-kernel.patch --] [-- Type: text/plain, Size: 2038 bytes --] diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c index f375a27..2922e9f 100644 --- a/crypto/async_tx/async_pq.c +++ b/crypto/async_tx/async_pq.c @@ -395,7 +395,7 @@ async_pq_zero_sum(struct page **blocks, unsigned int offset, int src_cnt, struct dma_async_tx_descriptor *tx = NULL; enum dma_ctrl_flags dma_flags = cb_fn ? DMA_PREP_INTERRUPT : 0; - BUG_ON(src_cnt < 2); + BUG_ON(src_cnt < 1); if (device && src_cnt <= dma_maxpq(device, 0) - 2) { dma_addr_t dma_src[src_cnt + 2]; @@ -486,7 +486,7 @@ async_syndrome_zero_sum(struct page **blocks, unsigned int offset, int src_cnt, struct dma_async_tx_descriptor *tx = NULL; enum dma_ctrl_flags dma_flags = cb_fn ? DMA_PREP_INTERRUPT : 0; - BUG_ON(src_cnt < 2); + BUG_ON(src_cnt < 1); if (device && src_cnt <= dma_maxpq(device, 0) - 2) { dma_addr_t dma_src[src_cnt + 2]; diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c index 50cd370..70869bb 100644 --- a/crypto/async_tx/async_xor.c +++ b/crypto/async_tx/async_xor.c @@ -183,7 +183,7 @@ async_xor(struct page *dest, struct page **src_list, unsigned int offset, struct dma_chan *chan = async_tx_find_channel(depend_tx, DMA_XOR, &dest, 1, src_list, src_cnt, len); - BUG_ON(src_cnt <= 1); + BUG_ON(src_cnt < 1); if (chan) { /* run the xor asynchronously */ diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index a76ef52..5ce7090 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4357,8 +4357,8 @@ static raid5_conf_t *setup_conf(mddev_t *mddev) mdname(mddev), mddev->new_layout); return ERR_PTR(-EIO); } - if (mddev->new_level == 6 && mddev->raid_disks < 4) { - printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n", + if (mddev->new_level == 6 && mddev->raid_disks < 3) { + printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 3)\n", mdname(mddev), mddev->raid_disks); return ERR_PTR(-EINVAL); } [-- Attachment #1.3: 3disk-raid6-mdadm.patch --] [-- Type: text/plain, Size: 410 bytes --] diff --git a/Create.c b/Create.c index 9e65d0a..bd79838 100644 --- a/Create.c +++ b/Create.c @@ -96,7 +96,7 @@ int Create(struct supertype *st, char *mddev, int mdfd, Name ": a RAID level is needed to create an array.\n"); return 1; } - if (raiddisks < 4 && level == 6) { + if (raiddisks < 3 && level == 6) { fprintf(stderr, Name ": at least 4 raid-devices needed for level 6\n"); return 1; [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] relax checks to support 3disk raid6 arrays 2009-03-20 9:14 ` [PATCH] relax checks to support 3disk raid6 arrays Andre Noll @ 2009-03-20 9:20 ` Peter Rabbitson 2009-03-20 9:29 ` Andre Noll 0 siblings, 1 reply; 5+ messages in thread From: Peter Rabbitson @ 2009-03-20 9:20 UTC (permalink / raw) To: Andre Noll; +Cc: Neil Brown, linux-raid Andre Noll wrote: > On 11:09, Neil Brown wrote: > >> Have you tried a 3-disk raid6 yet? Any conclusions? > > Yes, I played around a bit and used the two attached patches that > relax some checks in the kernel and in mdadm. It appears to work fine, > but I did only minimal testing with small loop devices, so I would > not recommend it for production use yet :) > > Regards > Andre > In the last lines of the patch: Name ": at least 4 raid-devices needed for level 6\n"); Cheers ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] relax checks to support 3disk raid6 arrays 2009-03-20 9:20 ` Peter Rabbitson @ 2009-03-20 9:29 ` Andre Noll 0 siblings, 0 replies; 5+ messages in thread From: Andre Noll @ 2009-03-20 9:29 UTC (permalink / raw) To: Peter Rabbitson; +Cc: Neil Brown, linux-raid [-- Attachment #1: Type: text/plain, Size: 343 bytes --] On 10:20, Peter Rabbitson wrote: > In the last lines of the patch: > Name ": at least 4 raid-devices needed for level 6\n"); Thanks, obviously I overlooked this. Of course this omission only causes mdadm to print an incorrect message. Regards Andre -- The only person who always got his work done by Friday was Robinson Crusoe [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-03-20 9:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-18 12:53 [PATCH] md: raid5 run(): Fix max_degraded for raid level 4 Andre Noll 2009-03-20 0:09 ` Neil Brown 2009-03-20 9:14 ` [PATCH] relax checks to support 3disk raid6 arrays Andre Noll 2009-03-20 9:20 ` Peter Rabbitson 2009-03-20 9:29 ` Andre Noll
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).