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

Bug #403767 reported by Kenneth Almquist on 2009-07-23
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm
Undecided
Unassigned
mdadm (Ubuntu)
Undecided
Unassigned

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;
+ }
+
   try_again:

   tmpdev = devlist; num_devs = 0;

ProblemType: Bug
Architecture: amd64
Dependencies:

DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: mdadm None [modified: /var/lib/dpkg/info/mdadm.list]
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: mdadm
Uname: Linux 2.6.28.9 x86_64
UnreportableReason: This is not a genuine Ubuntu package

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 2.6.7.1-1ubuntu8; the version number wasn't picked up in the bug report because I uninstalled the mdadm package.

ceg (ceg) wrote :

patch above

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) on 2010-03-31
summary: - madam: no devices found for /dev/md0
+ {upstream} madam: no devices found for /dev/md0
ceg (ceg) on 2010-04-01
Changed in mdadm (Ubuntu):
status: New → Invalid
ceg (ceg) on 2010-04-01
Changed in mdadm (Ubuntu):
status: Invalid → New
tags: added: patch
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  Edit
Everyone can see this information.

Other bug subscribers

Patches