]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fstests: quota grace periods unreliable under load
authorDave Chinner <dchinner@redhat.com>
Wed, 27 Nov 2024 00:14:03 +0000 (11:14 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:19:27 +0000 (22:19 +0800)
Starting the quota grace period doesn't necessary happen predictably
when the system is under heavy load. This results in random test
failures where grace period timeouts are expected.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/601
tests/xfs/050

index 9860505babaa3d517ae26271799faaca81f6e0ad..78b6a4aaa13748b0d8b73c45f446f8883553c81a 100755 (executable)
@@ -52,9 +52,10 @@ $XFS_QUOTA_PROG -x -c "timer -u -i 100 $qa_user" $SCRATCH_MNT
 # raw ("since epoch") grace expiry
 get=`repquota -up $SCRATCH_MNT | grep  "^$qa_user" | awk '{print $NF}'`
 
-# Either the new expiry must match; or be one second after the set time, to
-# deal with the seconds counter incrementing.
-if [ "$get" != "$set" ] && [ "$get" -ne "$((set + 1))" ]; then
+# Either the new expiry must match or be soon after the set time as there
+# may be load related delays on setting the new timer. A 10s "grace" window
+# should be enough for everyone.
+if [ "$get" != "$set" ] && [ "$get" -gt "$((set + 10))" ]; then
        echo "set grace to $set but got grace $get"
 fi
 
index 7baaaeaa3efcf9e6d4334caa0719b381e9d611ec..78303bf784d05ecfe97d9fd854039bd395cfa9eb 100755 (executable)
@@ -115,6 +115,11 @@ _exercise()
        echo
        echo "*** push past the soft block limit" | tee -a $seqres.full
        _file_as_id $SCRATCH_MNT/softie $id $type $bsize 300
+
+       # sync so that the data is actually allocated as soft limit timers
+       # are not started until block allocation is done. This means the test
+       # will work even if remount sliently fails due to busy mounts
+       _scratch_sync
        _qmount
        $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
                -c "repquota -birnN -$type" $SCRATCH_DEV |