This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 465542 - mkinitrd drops md raid members after first (F) or (S) disk
mkinitrd drops md raid members after first (F) or (S) disk
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: mkinitrd (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 469611
  Show dependency treegraph
 
Reported: 2008-10-03 15:42 EDT by Alexandre Oliva
Modified: 2008-12-04 23:02 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-04 23:02:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patches are nicer as attachments :-) (827 bytes, patch)
2008-10-03 15:43 EDT, Alexandre Oliva
no flags Details | Diff
Improved version of the previous patch, covering write-mostly (W) too (828 bytes, patch)
2008-10-17 20:17 EDT, Alexandre Oliva
no flags Details | Diff

  None (edit)
Description Alexandre Oliva 2008-10-03 15:42:38 EDT
When mdstat lists spare or failed raid members before active ones, mkinitrd won't see them.  If they're necessary to bring up the root device, you lose.  Big problem, especially when the member became failed because of bug 465539, or it became spare because something went wrong in the current udev(?)-based progressive bringing up of array members (that often causes members brought in a bit too late to come up as spares needing resync).

This patch strips the (S)s and (F)s from the list of md raid components, enabling a successful probing of all member devices.  Without it, findstoragedriver returns after failing to locate a /sys/block/$device for say sda1([SF]).  I found it odd that it would return rather than continue on to the next argument, so I fixed that too.  If there's a stronger reason to return, please drop that part of the patch.

--- /tmp/mkinitrd.orig	2008-10-03 05:56:07.000000000 -0300
+++ /tmp/mkinitrd	2008-10-03 16:40:46.000000000 -0300
@@ -384,7 +384,7 @@
                 sysfs=$(for x in /sys/block/* ; do findone -type d $x/ -name $device; done)
             fi
         fi
-        [ -z "$sysfs" ] && return
+        [ -z "$sysfs" ] && continue
         qpushd $sysfs
         findstoragedriverinsys
         qpopd
@@ -582,7 +582,7 @@
     fi
 
     levels=$(awk "/^$1[	 ]*:/ { print\$4 }" /proc/mdstat)
-    devs=$(gawk "/^$1[	 ]*:/ { print gensub(\"\\\\[[0-9]*\\\\]\",\"\",\"g\",gensub(\"^md.*raid[0-9]*\",\"\",\"1\")) }" /proc/mdstat)
+    devs=$(gawk "/^$1[	 ]*:/ { print gensub(\"\\\\[[0-9]*\\\\](\\\\([SF]\\\\))?\",\"\",\"g\",gensub(\"^md.*raid[0-9]*\",\"\",\"1\")) }" /proc/mdstat)
 
     for level in $levels ; do
         case $level in
Comment 1 Alexandre Oliva 2008-10-03 15:43:24 EDT
Created attachment 319410 [details]
Patches are nicer as attachments :-)
Comment 2 Alexandre Oliva 2008-10-17 20:17:06 EDT
Created attachment 320733 [details]
Improved version of the previous patch, covering write-mostly (W) too

Can we please have this patch installed?  Without it, write-mostly is broken, and spares may get you in trouble unless you notice they took over before a reboot.  This is not just for failure cases, write-mostly is present in regular operation.
Comment 3 Alexandre Oliva 2008-11-03 00:45:10 EST
Could this trivial patch be integrated, pretty please?
Comment 4 Peter Jones 2008-11-03 17:30:52 EST
Patch will be applied in 6.0.70-1 .
Comment 5 Bug Zapper 2008-11-25 22:31:35 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Alexandre Oliva 2008-12-04 23:02:48 EST
Confirmed fixed in F-10 GOLD, thanks.

Note You need to log in before you can comment on or make changes to this bug.