aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2023-06-06 15:29:08 -0700
committerZorro Lang <zlang@kernel.org>2023-06-10 15:35:59 +0800
commit156a8a1078509f5cc4bf528bf7246208641ee67e (patch)
treed292ef6124995bbf0d7798ac3e238d2a9707ebd9
parent3ed1150fd7b8ee2d79cfc2120468fc62dec8d0ca (diff)
downloadxfstests-dev-156a8a1078509f5cc4bf528bf7246208641ee67e.tar.gz
xfs/108: allow slightly higher block usage
With pmem and fsdax enabled, I occasionally see this test fail on XFS: Mode: (0600/-rw-------) Uid: (1) Gid: (2) Disk quotas for User #1 (1) Filesystem Blocks Quota Limit Warn/Time Mounted on -SCRATCH_DEV 48M 0 0 00 [------] SCRATCH_MNT +SCRATCH_DEV 48.0M 0 0 00 [------] SCRATCH_MNT Disk quotas for User #1 (1) Filesystem Files Quota Limit Warn/Time Mounted on SCRATCH_DEV 3 0 0 00 [------] SCRATCH_MNT The cause of this failure is fragmentation in the file mappings that results in a block mapping structure that no longer fits in the inode. Hence the block usage is 49160K instead of the 49152K that was written. Use some fugly sed duct tape to make this test accomodate this possiblity. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Bill O'Donnell <bodonnel@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-xtests/xfs/10814
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/xfs/108 b/tests/xfs/108
index 4607000544..8593edbdd2 100755
--- a/tests/xfs/108
+++ b/tests/xfs/108
@@ -32,6 +32,14 @@ test_files()
done
}
+# Some filesystem configurations fragment the file mapping more than others,
+# which leads to the quota block counts being slightly higher than the 48MB
+# written.
+filter_quota()
+{
+ sed -e 's/48\.[01]M/48M/g' | _filter_quota
+}
+
test_accounting()
{
echo "### some controlled buffered, direct and mmapd IO (type=$type)"
@@ -49,9 +57,9 @@ test_accounting()
$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
+ $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
}
export MOUNT_OPTIONS="-opquota"