diff mbox series

[3/4] xfs/108: sync filesystem before querying quota

Message ID 163045514094.771394.18013113541883760708.stgit@magnolia (mailing list archive)
State Accepted, archived
Headers show
Series fstests: exercise code changes in 5.15 | expand

Commit Message

Darrick J. Wong Sept. 1, 2021, 12:12 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

The new deferred inactivation code is lazy about deallocating deleted
files, which means that we need to be more proactive about syncing the
filesystem after deleting things.  When reporting quotas, XFS only
flushes the deferred work if we query quota id 0, so we need the
explicit sync to ensure the quota numbers are not affected by laziness.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/108 |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tests/xfs/108 b/tests/xfs/108
index 8a102133..a3a4c8d4 100755
--- a/tests/xfs/108
+++ b/tests/xfs/108
@@ -47,6 +47,7 @@  test_accounting()
 	for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
 		$here/src/lstat64 $file | head -3 | _filter_scratch
 	done
+	sync
 	$XFS_QUOTA_PROG -c "quota -hnb -$type $id" $QARGS | _filter_quota
 	$XFS_QUOTA_PROG -c "quota -hni -$type $id" $QARGS | _filter_quota
 	$XFS_QUOTA_PROG -c "quota -hnr -$type $id" $QARGS | _filter_quota