From: Neil Brown <neilb@suse.de>
To: Brett King <king.br@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: compute_blocknr: map not correct error during RAID6 reshape 6 -> 7 disks, mdadm 3.1.2 / kernel 2.6.34-rc3
Date: Tue, 20 Apr 2010 14:14:42 +1000 [thread overview]
Message-ID: <20100420141442.2ca76b48@notabene.brown> (raw)
In-Reply-To: <z2q8cf253381004192043haf99536cvfb2bf6fcfb40fa4d@mail.gmail.com>
On Tue, 20 Apr 2010 13:43:08 +1000
Brett King <king.br@gmail.com> wrote:
> Hello,
> It's been quiet on this issue to date and I assume everyone's working
> on important fixes and features etc - my apologies for the annoyance
> however at this point I'm looking for some collective guidance on my
> next move as I can't leave things in this state.
>
> To summarize, I am attempting to grow a RAID6 array from 6 to 7x 2TB
> disks however the reshape is stalling at 87.9% and throwing
> 'compute_blocknr: map not correct' errors. The system still responds
> but needs a hard reset to do anything MD related.
Thanks for the reminder.
Please try the following patch.
NeilBrown
From 45b14940d3fbf1891d5c2f99f334cc4f7d9e36d3 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Tue, 20 Apr 2010 14:13:34 +1000
Subject: [PATCH] md/raid5: allow for more than 2^31 chunks.
With many large drives and small chunk sizes it is possible
to create a RAID5 with more than 2^31 chunks. Make sure this
works.
Reported-by: Brett King <king.br@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e3e9a36..20e4840 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1650,8 +1650,8 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
int previous, int *dd_idx,
struct stripe_head *sh)
{
- long stripe;
- unsigned long chunk_number;
+ sector_t stripe;
+ sector_t chunk_number;
unsigned int chunk_offset;
int pd_idx, qd_idx;
int ddf_layout = 0;
@@ -1671,17 +1671,12 @@ static sector_t raid5_compute_sector(raid5_conf_t *conf, sector_t r_sector,
*/
chunk_offset = sector_div(r_sector, sectors_per_chunk);
chunk_number = r_sector;
- BUG_ON(r_sector != chunk_number);
/*
* Compute the stripe number
*/
- stripe = chunk_number / data_disks;
-
- /*
- * Compute the data disk and parity disk indexes inside the stripe
- */
- *dd_idx = chunk_number % data_disks;
+ stripe = chunk_number;
+ *dd_idx = sector_div(stripe, data_disks);
/*
* Select the parity disk based on the user selected algorithm.
@@ -1870,14 +1865,14 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
: conf->algorithm;
sector_t stripe;
int chunk_offset;
- int chunk_number, dummy1, dd_idx = i;
+ sector_t chunk_number;
+ int dummy1, dd_idx = i;
sector_t r_sector;
struct stripe_head sh2;
chunk_offset = sector_div(new_sector, sectors_per_chunk);
stripe = new_sector;
- BUG_ON(new_sector != stripe);
if (i == sh->pd_idx)
return 0;
@@ -1970,7 +1965,7 @@ static sector_t compute_blocknr(struct stripe_head *sh, int i, int previous)
}
chunk_number = stripe * data_disks + i;
- r_sector = (sector_t)chunk_number * sectors_per_chunk + chunk_offset;
+ r_sector = chunk_number * sectors_per_chunk + chunk_offset;
check = raid5_compute_sector(conf, r_sector,
previous, &dummy1, &sh2);
next prev parent reply other threads:[~2010-04-20 4:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-16 1:56 compute_blocknr: map not correct error during RAID6 reshape 6 -> 7 disks, mdadm 3.1.2 / kernel 2.6.34-rc3 Brett King
2010-04-20 3:43 ` Brett King
2010-04-20 4:14 ` Neil Brown [this message]
2010-04-22 3:43 ` Brett King
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=20100420141442.2ca76b48@notabene.brown \
--to=neilb@suse.de \
--cc=king.br@gmail.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 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.