[PATCH 39/40] fstests: quota grace periods unreliable under load

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



From: Dave Chinner <dchinner@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 tests/generic/601 | 7 ++++---
 tests/xfs/050     | 5 +++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/generic/601 b/tests/generic/601
index 9860505ba..78b6a4aaa 100755
--- a/tests/generic/601
+++ b/tests/generic/601
@@ -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
 
diff --git a/tests/xfs/050 b/tests/xfs/050
index 7baaaeaa3..78303bf78 100755
--- a/tests/xfs/050
+++ b/tests/xfs/050
@@ -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 |
-- 
2.45.2





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux