Bug#684708: mdadm: support external metadata arrays correctly

Michael Tokarev mjt at tls.msk.ru
Sun Oct 21 10:58:04 UTC 2012


On 21.10.2012 13:46, Michael Tokarev wrote:

> So, finally, this whole "stop" case - I'd write it like this:
> 
>  stop)
>    sync   # XXX it can be a bad idea to sync here?
>    # check if there are ANY arrays, and stop any ongoing sync_actions
>    wait=
>    for sf in /sys/block/md* ; do
       [ -d "$sf/md" ] || continue
>      [ "$wait" ] || log_action_begin_msg "Waiting for MD arrays to become idle"
>      wait=y
>      [ -w $sf/md/sync_action ] && echo idle > $sf/md/sync_action
>    done
>    if [ ! "$wait" ]; then :
>    # Wait for the array to become idle (max 5 secs)
>    elif ! $MDADM --wait-clean --scan; then
>      log_action_end_msg 1
>      sleep 1
>    else
>      log_action_end_msg 0
>    fi
>    ;;
> 
> If it's okay for you (modulo possible bugs/typos -- I didn't
> try to run this code!), I'll use this version.

/mjt



More information about the pkg-mdadm-devel mailing list