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>
_supported_fs xfs
_require_scratch
_require_xfs_quota
+_require_xfs_io_command "syncfs"
test_files()
{
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