Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 198892
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Genkernel Maintainers <genkernel@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Robin Johnson <robbat2@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
busybox-1.1.3+gentoo-mdadm-r1.patch Additional patch for busybox mdadm patch Javier Miqueleiz 2007-11-20 12:35 0000 1.17 KB Details | Diff
busybox-1.1.3+gentoo-mdadm3.patch Additional patch to support 1.1 and 1.2 metadata versions patch Javier Miqueleiz 2008-02-11 07:01 0000 1014 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 198892 depends on: Show dependency tree
Bug 198892 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-11-12 06:03 0000
Booting on my G5, with domdadm. I have 3 MD devices, md0 = /boot, md1 = /, md2
= LVM.

>> Detected real_root as a md device. Setting up the device node...
mdadm: error opening /dev/md/0: No such file or directory
mdadm: failed to open array
mdadm: error opening /dev/md/1: No such file or directory
mdadm: failed to open array
mdadm: error opening /dev/md/2: No such file or directory
mdadm: failed to open array
>> ...

I changed the /etc/mdadm.conf in the initramfs to use the /dev/mdX names
instead of /dev/md/X, and then I found that it only starts the first device
listed in the mdadm.conf file.

The /etc/mdadm.conf was generated with the busybox mdadm in the first place, so
I guess it fails for the lack of the /dev/md/ directory.

------- Comment #1 From Chris Gianelloni (RETIRED) 2007-11-13 22:50:45 0000 -------
OK.  How do I fix it, then?

------- Comment #2 From Javier Miqueleiz 2007-11-18 22:44:35 0000 -------
Seems a bug with busybox mdadm patch.

The function "int mdassemble_main()" expects the "/dev/md" string (without the
trailing /). This function is called to assemble the arrays.

In contrast, the function "brief_examine_super1()" writes "ARRAY /dev/md/".
This function is invoked in order to examine the devices (the output of
/etc/mdadm.conf comes from this one).

I tried deleting the slash in "brief_examine_super1()". Now works for me. The
array is assembled.

There seems to be another bug in the function "int mdassemble_main()". The if
condition for creating the node should be based on errno instead of the return
value of strtoul(). This function returns a long value (the minor number), not
an error condition.

Want to test with more than one array to verify things. But seems pretty clear.

The patch to mdadm is trivial, but can provide it anyway.

------- Comment #3 From Javier Miqueleiz 2007-11-20 12:35:01 0000 -------
Created an attachment (id=136482) [details]
Additional patch for busybox mdadm

------- Comment #4 From Javier Miqueleiz 2007-11-20 12:53:50 0000 -------
Attached the patch.

Have tested it creating up to 3 different arrays. All of them are started ok.

Have found problems if the metadata version is 1.1 or 1.2 (haven't tried with
the old version 0.9). Only version 1.0 arrays are started.

BTW, sys-fs/mdadm was also affected by a bug similar to this (was fixed in
release 2.6.3 though). Perhaps both bugs are related.

------- Comment #5 From Robin Johnson 2007-11-20 14:03:18 0000 -------
I'll try it in 12 hours or so. I have 0.9, 1.0 and 1.1 metadata arrays.

Some mdadm/kernel versions have a glitch that causes them to behave weirdly
with metadata 1.0 arrays as well.

------- Comment #6 From Chris Gianelloni (RETIRED) 2007-11-24 15:59:52 0000 -------
Robin:  any word?

------- Comment #7 From Robin Johnson 2007-11-24 20:57:16 0000 -------
Ok, it generates the mdadm.conf correctly now, 0.9 metadata works fine, v1.1 is
detected, but not assembled: 'no devices found'

------- Comment #8 From Javier Miqueleiz 2007-11-26 20:04:32 0000 -------
Thank you for testing, Robin ;-).

You confirm we still have some bugs with versions 1.1 and 1.2. Versions 0.9 and
1.0 are working ok. I will have a look at busybox mdadm and try to propose a
patch. I expect to do it this week.

BTW, could you be more explicit about that bug regarding some mdadm/kernel
versions?

------- Comment #9 From Robin Johnson 2007-11-26 23:35:30 0000 -------
For the main mdadm/kernel bugs, boot one of the pre-release 2007.1 media (I ran
into the bug on the ppc64 media that I was testing for rangerpb), and try to
create a 1.0 array. It will be created, but mdadm will fail to start it. If you
then try to assemble it manually using the sysfs interface, you'll get a
backtrace in the kernel, and the box hangs in some cases.
That's why my md3 is v1.1 actually. I prefer 1.0 and 0.9, since the superblocks
are at the end of the device, so they don't block unmodified booting of a RAID1
device.
I was using real disk, and I'm not sure if it happens with loop devices offhand
(it should tho).

(see "man md" for the exact details).
0.9 - superblock located in the last 64-128K of device, 64Kb in size. 
1.0 - superblock located in the last 8-12K of device.
1.1 - at start of device.
1.2 - starting at 4K in the device.

------- Comment #10 From Chris Gianelloni (RETIRED) 2007-11-28 21:46:49 0000 -------
I've gone ahead and added this.  I'd rather we support *some* of the versions
than none.

------- Comment #11 From Chris Gianelloni (RETIRED) 2007-11-28 22:32:08 0000 -------
This should be done in 3.4.9_pre10 which will be hitting the tree soon.

------- Comment #12 From Javier Miqueleiz 2007-11-29 19:46:15 0000 -------
Seems reasonable to me. We only gain functionality since it doesn't work now.

A fully working version supporting all 4 metadata types could be released in
another genkernel revision.

Just my opinion. I would like to hear Robin about this.

------- Comment #13 From Robin Johnson 2007-11-29 20:22:12 0000 -------
we're only moving forward by including it, no objections from me.
getting there in small steps is a help when doing a big step in one go isn't
available.

------- Comment #14 From Javier Miqueleiz 2008-02-11 06:59:48 0000 -------
Attached a new patch against sys-kernel/genkernel-3.4.9 to support all 4
metadata versions (i.e., 0.9, 1.0, 1.1 and 1.2).

The patch is based on some changes from full mdadm-2.6.2 to mdadm-2.6.3 (so
credit should go to Neil Brown).

Have reasonably tested and think it should work fine.

------- Comment #15 From Javier Miqueleiz 2008-02-11 07:01:36 0000 -------
Created an attachment (id=143185) [details]
Additional patch to support 1.1 and 1.2 metadata versions

------- Comment #16 From Chris Gianelloni (RETIRED) 2008-02-14 06:10:54 0000 -------
OK, I added the mdadm3 patch to SVN, so it'll show up in 3.4.10_pre2...

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug