From a0e085215e05a4ce7a65d24722f99d9811f1a0c7 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 1 Nov 2018 16:19:09 -0700 Subject: [PATCH] quota: clean out speculative preallocations when checking quota usage 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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- common/quota | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/quota b/common/quota index 993ff5de..9309e786 100644 --- a/common/quota +++ b/common/quota @@ -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" ;; *) ;; -- 2.39.5