From: NeilBrown Date: Thu, 23 Jul 2015 01:17:10 +0000 (+1000) Subject: test: assume recovery has completed if sync_completed says so. X-Git-Tag: mdadm-3.3.3~5 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=commitdiff_plain;h=6fba5a339c86731cfb6d3e2bb954deb578d2873a test: assume recovery has completed if sync_completed says so. The final completion of a recovery can be delayed, so use sync_completed to check if it is finished, just not been reaped. Signed-off-by: NeilBrown --- diff --git a/test b/test index 939410ce..d0a6cb85 100755 --- a/test +++ b/test @@ -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 ;;