{upstream} madam: no devices found for /dev/md0

Bug #403767 reported by Kenneth Almquist
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)

Bug Description

Binary package hint: mdadm

Attempting to assemble an array using the command:

    mdadm -A /dev/md0 /dev/mapper/raid5a /dev/mapper/raid5b /dev/mapper/raid5c

produces the error message:

    madam: no devices found for /dev/md0

The problem is that the Assemble routine in Assemble.c silently ignores all devices for which "used" is nonzero. The "used" field is not initialized, so whether or not the used field is non-zero depends on what happens to be in memory. The above error message appears when the "used" fields for all of the arguments are nonzero.

The patch below set the "used" fields to zero before the main loop is entered for the first time, which appears to fix the problem.

*** Assemble.c-orig 2009-07-18 16:09:55.000000000 -0400
--- Assemble.c 2009-07-18 16:31:27.000000000 -0400
*** 184,189 ****
--- 184,198 ----
   else if (mdfd >= 0)
    inargv = 1;

+ /*
+ * Initially mark all devices as not used.
+ */
+ for (tmpdev = devlist;
+ tmpdev;
+ tmpdev = tmpdev->next) {
+ tmpdev->used = 0;
+ }

   tmpdev = devlist; num_devs = 0;

ProblemType: Bug
Architecture: amd64

DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: mdadm None [modified: /var/lib/dpkg/info/mdadm.list]
SourcePackage: mdadm
Uname: Linux x86_64
UnreportableReason: This is not a genuine Ubuntu package

Revision history for this message
Kenneth Almquist (kalmquist4) wrote :

I see that Launchpad changed the indentation in the included patch, but it's short so you can retype it. The version of mdadm I had installed was; the version number wasn't picked up in the bug report because I uninstalled the mdadm package.

Revision history for this message
ceg (ceg) wrote :

patch above

Revision history for this message
ceg (ceg) wrote :

attatching above patch again as a file upload in order for this issue being listeted as containing patch.

summary: - "mdadm -A device..." fails
+ madam: no devices found for /dev/md0
ceg (ceg)
summary: - madam: no devices found for /dev/md0
+ {upstream} madam: no devices found for /dev/md0
ceg (ceg)
Changed in mdadm (Ubuntu):
status: New → Invalid
ceg (ceg)
Changed in mdadm (Ubuntu):
status: Invalid → New
tags: added: patch
Revision history for this message
Nigel Babu (nigelbabu) wrote :

Thank for the patch. Please forward the patch upstream, if its already forwarded, link the bug, and if accepted, please link the commit ID in a comment.

tags: added: patch-needswork
removed: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers


Remote bug watches

Bug watches keep track of this bug in other bug trackers.