From 1c523c074aa35a082987c91d42082a85c312b9fb Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Fri, 24 May 2024 19:28:47 +0300 Subject: [PATCH] LU-15053 tests: sanity-quota_13 fix Scope a case when there are any extra users with quota limit and non zero usage besides TSTUSR and TSTUSR2. This is possible when tests are started with ENABLE_QUOTA=yes. In a such case each user may have a lock between OST and QMT depending. Take this into account in sanity-quota_13. Fix with following failure: sanity-quota test_13: @@@@@@ FAIL: 2 cached locks Test-Parameters: trivial testlist=sanity-quota Test-Parameters: testlist=sanity-quota env=ONLY=13,ONLY_REPEAT=100 Signed-off-by: Sergey Cheremencev Change-Id: Iaf48d0eb80eef0fc5ebc8246e8fac3f9c96563c0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55197 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Hongchao Zhang Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 236d145..654d633 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -2663,25 +2663,26 @@ test_13(){ # clear the locks in cache first do_facet ost1 $LCTL set_param -n $procf=clear - local nlock=$(do_facet ost1 $LCTL get_param -n $procf) - [ $nlock -eq 0 ] || error "$nlock cached locks" + local init_nlock=$(do_facet ost1 $LCTL get_param -n $procf) # write to acquire the per-ID lock $RUNAS $DD of=$TESTFILE count=1 oflag=sync || quota_error a $TSTUSR "dd failed" - nlock=$(do_facet ost1 $LCTL get_param -n $procf) - [ $nlock -eq 1 ] || error "lock count($nlock) isn't 1" + local nlock=$(do_facet ost1 $LCTL get_param -n $procf) + [ $nlock -eq $((init_nlock + 1)) ] || + error "lock count($nlock) != $init_lock + 1" # clear quota doesn't trigger per-ID lock cancellation resetquota -u $TSTUSR nlock=$(do_facet ost1 $LCTL get_param -n $procf) - [ $nlock -eq 1 ] || error "per-ID lock is lost on quota clear" + [ $nlock -eq $((init_nlock + 1)) ] || + error "per-ID lock is lost on quota clear" # clear the per-ID lock do_facet ost1 $LCTL set_param -n $procf=clear nlock=$(do_facet ost1 $LCTL get_param -n $procf) - [ $nlock -eq 0 ] || error "per-ID lock isn't cleared" + [ $nlock -eq $init_nlock ] || error "per-ID lock isn't cleared" # spare quota should be released local OSTUUID=$(ostuuid_from_index 0) -- 1.8.3.1