From 98189c0751906493cda0555e5706bf313f74dccc Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Mon, 3 Apr 2023 21:05:39 -0400 Subject: [PATCH] LU-16735 test: cancel MDC locks and wait recovery During test_35, the MDC LDLM locks should also be cancelled to flush the pending operations and the recovery should be waited to complete before checking the quota. Lustre-change: https://review.whamcloud.com/50638 Lustre-commit: 6c42ca6e445ff41f17c92f1ec875479388a59212 Test-Parameters: trivial testlist=sanity-quota mdscount=2 mdtcount=4 Change-Id: I6508644976be77ad2895107abf90144b51790cfe Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50644 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/tests/sanity-quota.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 9eba46d..d863147 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -3418,6 +3418,7 @@ test_35() { error "write failed" is_project_quota_supported && change_project -p $TSTPRJID $DIR/$tdir/$tfile + cancel_lru_locks mdc cancel_lru_locks osc echo "Wait for setattr on objects finished..." @@ -3454,13 +3455,17 @@ test_35() { log "Restart..." stopall setupall + wait_recovery_complete quota_init echo "Verify disk usage after restart" local USED=$(getquota -u $TSTID global curspace) - [ $USED -eq $ORIG_USR_SPACE ] || + [ $USED -eq $ORIG_USR_SPACE ] || { + ls -al $DIR/$tdir/$tfile + $LFS quota -v -u $TSTID $DIR error "Used space for user $TSTID changed from " \ "$ORIG_USR_SPACE to $USED" + } USED=$(getquota -u $TSTID global curinodes) [ $USED -eq $ORIG_USR_INODES ] || error "Used inodes for user $TSTID changed from " \ @@ -3473,7 +3478,7 @@ test_35() { [ $USED -eq $ORIG_GRP_INODES ] || error "Used inodes for group $TSTID changed from " \ "$ORIG_GRP_INODES to $USED" - if [ $project_supported == "yes" ]; then + if [ $project_supported = "yes" ]; then USED=$(getquota -p $TSTPRJID global curinodes) [ $USED -eq $ORIG_PRJ_INODES ] || error "Used inodes for project $TSTPRJID " \ @@ -3500,7 +3505,7 @@ test_35() { [ $USED -gt $ORIG_GRP_SPACE ] || error "Used space for group $TSTID isn't increased" \ "orig:$ORIG_GRP_SPACE, now:$USED" - if [ $project_supported == "yes" ]; then + if [ $project_supported = "yes" ]; then USED=$(getquota -p $TSTPRJID global curspace) [ $USED -gt $ORIG_PRJ_SPACE ] || error "Used space for project $TSTPRJID isn't " \ -- 1.8.3.1