]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/108: sync filesystem before querying quota
authorDarrick J. Wong <djwong@kernel.org>
Wed, 1 Sep 2021 00:12:20 +0000 (17:12 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 12 Sep 2021 10:16:13 +0000 (18:16 +0800)
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 <djwong@kernel.org>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/108

index 8a102133a622ca1e84724c6fa726b4dae3734bb5..4607000544c0314dd0513b8ed32af99710261399 100755 (executable)
@@ -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