quota: clear speculative delalloc when checking quota usage

Occasionally speculative preallocation kicks in when writing files
to a filesystem under test.  These preallocations consume quota and
/usually/ aren't around after we drop_caches, but there's nothing to
guarantee that they actually have, so the quota reports will be
different before and after the fs remount, causing sporadic test
failures in generic/{23[123],270}.

We now have xfs_spaceman which can instruct XFS to forcibly remove
the speculative preallocations.  This fixes the sporadic failures,
at least for XFS.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-10-25 22:51:39 -07:00
committed by Eryu Guan
parent 23e7ba4e10
commit 148090c1c4
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -267,6 +267,12 @@ _check_quota_usage()
VFS_QUOTA=1
quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
;;
xfs)
# Clear out speculative preallocations to eliminate them
# as a source of intermittent orig/checked differences.
test -x "$XFS_SPACEMAN_PROG" && \
"$XFS_SPACEMAN_PROG" -c 'prealloc -s' $SCRATCH_MNT
;;
*)
;;
esac