Bug#462154: mdadm: It's not only --monitor --scan

mechanix at debian.org mechanix at debian.org
Wed Apr 16 06:39:36 UTC 2008


Hi Neil (and all others),

On Thu, Mar 06, 2008 at 02:54:28PM +1100, Neil Brown wrote:
> On Tuesday March 4, pernegger at gmail.com wrote:
> > 
> > I've had it after a few creates (raid benchmarking atm) as well, and assembles.
> > It seems to crash *after* what it's supposed to do, though, i. e.:
> > 
> > segfault at 0000000000000000 rip 0000000000412d2c rsp 00007fffc0bf9eb0 error 4
<...>
> 
> If this is at all repeatable, then it would be great if you can run it
> under 'gdb' and get a stack trace.
> i.e
>    gdb `which mdadm`
>    run ...mdadm options....
>   wait for segfault
>    where

FYI: there is a stack trace in the original Debian bug report, the
relevant message is at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=462154#5

I can reliably get the same stack trace with a non-stripped mdadm binary,
if I run it with the "--monitor --scan" arguments AND any md device is in
either auto-read-only or manually set read-only mode.

For the time being I "fixed" it by setting such devices to readwrite in
the init script:

...
      if egrep -q "active ?\((auto-)?read-only\)" /proc/mdstat; then
        log_daemon_msg "Marking all MD devices as read-write"
        egrep "active ?\((auto-)?read-only\)" /proc/mdstat | while read MDEV MINFO; do
          log_progress_msg "$MDEV"
          $MDADM --manage --readwrite /dev/$MDEV
        done
        log_end_msg 0
      fi
...

(inserted before the 'log_daemon_msg "Starting MD monitoring service" "mdadm --monitor"'
line in the start case from the init script)
(the funny egrep regex is because there's a difference in /proc/mdstat
between manually and auto set read-only devices; maybe only the auto state
should be checked)

I'm not sure that this is entirely safe to do for everyone, though.


KR,

Filip

-- 
My writings: http://blog.sysfs.net/





More information about the pkg-mdadm-devel mailing list