From: Darrick J. Wong Date: Wed, 1 Sep 2021 00:12:20 +0000 (-0700) Subject: xfs/108: sync filesystem before querying quota X-Git-Tag: v2022.05.01~235 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=189eb6048564ea340d4acdbc2daf3acd72fdaa93;p=xfstests-dev.git xfs/108: sync filesystem before querying quota 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. [Eryu: replace the global sync with xfs_io syncfs command] Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/xfs/108 b/tests/xfs/108 index 8a102133..46070005 100755 --- a/tests/xfs/108 +++ b/tests/xfs/108 @@ -17,6 +17,7 @@ _begin_fstest quota auto quick _supported_fs xfs _require_scratch _require_xfs_quota +_require_xfs_io_command "syncfs" test_files() { @@ -47,6 +48,7 @@ test_accounting() for file in $SCRATCH_MNT/{buffer,direct,mmap}; do $here/src/lstat64 $file | head -3 | _filter_scratch done + $XFS_IO_PROG -c syncfs $SCRATCH_MNT $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