From: Jinshan Xiong Date: Wed, 10 May 2017 17:39:25 +0000 (-0700) Subject: LU-7372 mgs: reprocess all locks at device fini X-Git-Tag: 2.10.51~35 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2dc19f20ba9fcc1bcac6ae7ee5169ce10caab882 LU-7372 mgs: reprocess all locks at device fini This is to avoid a case that IR lock revocation is going on when the obd is being stopped, an extra ldlm_reprocess_recovery_done() is required to make revocation process move forward. Turn off 'set -e' in rundbench. Otherwise killing dbench process will return an error to wait(1) in rundbench. Since test-framework has turned on error on exit, it will set test result as failure, which is actually a false alarm. Test-Parameters: envdefinitions=SLOW=yes,ONLY=26 testlist=replay-dual,replay-dual,replay-dual,replay-dual Signed-off-by: Jinshan Xiong Signed-off-by: Bobi Jam Change-Id: I43ab1df9c8fe5aea15da6c90175fd08a0b099ea2 Reviewed-on: https://review.whamcloud.com/17853 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 8b32309..b712e22 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -2528,6 +2528,11 @@ int ldlm_export_cancel_locks(struct obd_export *exp) "left on hash table %d.\n", exp, ecl.ecl_loop, atomic_read(&exp->exp_lock_hash->hs_count)); + if (ecl.ecl_loop > 0 && + atomic_read(&exp->exp_lock_hash->hs_count) == 0 && + exp->exp_obd->obd_stopping) + ldlm_reprocess_recovery_done(exp->exp_obd->obd_namespace); + return ecl.ecl_loop; } diff --git a/lustre/tests/rundbench b/lustre/tests/rundbench index 601b74c..11f6191 100755 --- a/lustre/tests/rundbench +++ b/lustre/tests/rundbench @@ -82,6 +82,10 @@ rm -rf dbench $LIBS71 client.txt exit 0 ' TERM +# turn off errexit. rundbench will return error code on failure +trap '' ERR +set +e + cd $DIR echo "running 'dbench $@' $PREFIX $PWD at `date`" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 5727455..7776af0 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -1,6 +1,6 @@ #!/bin/bash -trap 'print_summary && touch $TF_FAIL && \ +trap 'print_summary && print_stack_trace | tee $TF_FAIL && \ echo "$TESTSUITE: FAIL: test-framework exiting on error"' ERR set -e #set -x