]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
quota: clean out speculative preallocations when checking quota usage
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 1 Nov 2018 23:19:09 +0000 (16:19 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 4 Nov 2018 14:51:00 +0000 (22:51 +0800)
On XFS, the only reliable way to clean out speculative post-eof
preallocations, delayed allocations, and speculative cow preallocations
is to cycle the filesystem mount.  Since we're comparing the post-test
quota counts against a freshly quotacheck to look for leaks, it's fine
to cycle the mount.  This eliminates sporadic quota count failures when
running xfstests with quotas enabled.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/quota

index 993ff5de90ea6e9d3fef35d1f2d73b1c671af863..9309e786bca4432637cb030dd73e46cd5154933e 100644 (file)
@@ -260,10 +260,10 @@ _check_quota_usage()
                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
+               # Only way to make this reliable with cow/delalloc/speculative
+               # preallocations is to unmount and remount the whole mess...
+               _scratch_unmount
+               _scratch_mount "-o usrquota,grpquota"
                ;;
        *)
                ;;