From 6c42ca6e445ff41f17c92f1ec875479388a59212 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Fri, 14 Apr 2023 19:12:21 +0800 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. 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/fs/lustre-release/+/50638 Reviewed-by: Andreas Dilger Reviewed-by: Lai Siyao Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/tests/sanity-quota.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index f6023f3..d6ab103 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -3510,7 +3510,7 @@ test_35() { error "write failed" is_project_quota_supported && change_project -p $TSTPRJID $DIR/$tdir/$tfile - cancel_lru_locks osc + cancel_lru_locks echo "Wait for setattr on objects finished..." wait_delete_completed @@ -3546,13 +3546,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 == $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 " \ @@ -3565,9 +3569,9 @@ 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 ] || + (( $USED == $ORIG_PRJ_INODES )) || error "Used inodes for project $TSTPRJID " \ "changed from $ORIG_PRJ_INODES to $USED" USED=$(getquota -p $TSTPRJID global curspace) @@ -3592,9 +3596,9 @@ 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 ] || + (( $USED > $ORIG_PRJ_SPACE )) || error "Used space for project $TSTPRJID isn't " \ "increased orig:$ORIG_PRJ_SPACE, now:$USED" fi -- 1.8.3.1