From: Neil Brown <neilb@suse.de>
To: Ronald Lembcke <es186@fen-net.de>
Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org
Subject: Re: Bug in 2.6.17 / mdadm 2.5.1
Date: Mon, 26 Jun 2006 11:06:51 +1000 [thread overview]
Message-ID: <17567.13099.133933.397389@cse.unsw.edu.au> (raw)
In-Reply-To: message from Ronald Lembcke on Sunday June 25
On Sunday June 25, es186@fen-net.de wrote:
> Hi!
>
> There's a bug in Kernel 2.6.17 and / or mdadm which prevents (re)adding
> a disk to a degraded RAID5-Array.
Thank you for the detailed report.
The bug is in the md driver in the kernel (not in mdadm), and only
affects version-1 superblocks. Debian recently changed the default
(in /etc/mdadm.conf) to use version-1 superblocks which I thought
would be OK (I've some testing) but obviously I missed something. :-(
If you remove the "metadata=1" (or whatever it is) from
/etc/mdadm/mdadm.conf and then create the array, it will be created
with a version-0.90 superblock has had more testing.
Alternately you can apply the following patch to the kernel and
version-1 superblocks should work better.
NeilBrown
-------------------------------------------------
Set desc_nr correctly for version-1 superblocks.
This has to be done in ->load_super, not ->validate_super
### Diffstat output
./drivers/md/md.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c 2006-06-26 11:02:43.000000000 +1000
+++ ./drivers/md/md.c 2006-06-26 11:02:46.000000000 +1000
@@ -1057,6 +1057,11 @@ static int super_1_load(mdk_rdev_t *rdev
if (rdev->sb_size & bmask)
rdev-> sb_size = (rdev->sb_size | bmask)+1;
+ if (sb->level == cpu_to_le32(LEVEL_MULTIPATH))
+ rdev->desc_nr = -1;
+ else
+ rdev->desc_nr = le32_to_cpu(sb->dev_number);
+
if (refdev == 0)
ret = 1;
else {
@@ -1165,7 +1170,6 @@ static int super_1_validate(mddev_t *mdd
if (mddev->level != LEVEL_MULTIPATH) {
int role;
- rdev->desc_nr = le32_to_cpu(sb->dev_number);
role = le16_to_cpu(sb->dev_roles[rdev->desc_nr]);
switch(role) {
case 0xffff: /* spare */
next prev parent reply other threads:[~2006-06-26 1:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060624104745.GA6352@defiant.crash>
2006-06-25 13:59 ` Ronald Lembcke
2006-06-26 1:06 ` Neil Brown [this message]
2006-06-26 1:53 ` Neil Brown
2006-06-26 21:24 ` Andre Tomt
2006-06-27 1:00 ` Neil Brown
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=17567.13099.133933.397389@cse.unsw.edu.au \
--to=neilb@suse.de \
--cc=es186@fen-net.de \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®