]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - test
re-add: make re-add try to write sysfs node first
[thirdparty/mdadm.git] / test
diff --git a/test b/test
index d09f3d8feca29ce8b5105953f9750dc5e2b1a929..d0a6cb8582129b4ff2b8266e088f94f26f90b1cd 100755 (executable)
--- a/test
+++ b/test
@@ -156,7 +156,7 @@ mdadm() {
     case $* in
        *-S* ) udevadm settle
               p=`cat /proc/sys/dev/raid/speed_limit_max`
-              echo 2000000 > /proc/sys/dev/raid/speed_limit_max
+              echo 20000 > /proc/sys/dev/raid/speed_limit_max
     esac
     case $* in
        *-C* ) $mdadm 2> $targetdir/stderr --quiet "$@" --auto=yes;;
@@ -205,8 +205,16 @@ check() {
 
      nosync )
        sleep 0.5
+       # Since 4.2 we delay the close of recovery until there has been a chance for
+       # spares to be activated.  That means that a recovery that finds nothing
+       # to do can still take a little longer than expected.
+       # add an extra check: is sync_completed shows the end is reached, assume
+       # there is no recovery.
        if grep -s -E '(resync|recovery|reshape) *=' > /dev/null /proc/mdstat ; then
+          incomplete=`grep / /sys/block/md*/md/sync_completed 2> /dev/null | sed '/^ *\([0-9]*\) \/ \1/d'`
+          if [ -n "$incomplete" ]; then
                echo >&2 "ERROR resync or recovery is happening!"; cat /proc/mdstat ; exit 1;
+          fi
        fi
      ;;
 
@@ -256,7 +264,7 @@ testdev() {
    dvsize=$3
    chunk=$4
    if [ -z "$5" ]; then
-      mkfs -j $dev > /dev/null 2>&1 && fsck -fn $dev >&2
+      mkfs.ext3 -F -j $dev > /dev/null 2>&1 && fsck -fn $dev >&2
    fi
    dsize=$[dvsize/chunk]
    dsize=$[dsize*chunk]