diff options
author | NeilBrown <neilb@suse.com> | 2015-07-23 03:17:10 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-07-23 03:17:10 +0200 |
commit | 6fba5a339c86731cfb6d3e2bb954deb578d2873a (patch) | |
tree | c56a26055ac50558434fdb038ab392ebc18f89c3 /test | |
parent | tests: flushbufs after writing zeros (diff) | |
download | mdadm-6fba5a339c86731cfb6d3e2bb954deb578d2873a.tar.xz mdadm-6fba5a339c86731cfb6d3e2bb954deb578d2873a.zip |
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 <neilb@suse.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 ;; |