generic/371: disable speculative preallocation regressions on XFS
[xfstests-dev.git] / tests / generic / 371
index c94fa85..a2fdaf7 100755 (executable)
@@ -18,10 +18,18 @@ _begin_fstest auto quick enospc prealloc
 _supported_fs generic
 _require_scratch
 _require_xfs_io_command "falloc"
+test "$FSTYP" = "xfs" && _require_xfs_io_command "extsize"
 
 _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
 _scratch_mount
 
+# Disable speculative post-EOF preallocation on XFS, which can grow fast enough
+# that a racing fallocate then fails.
+if [ "$FSTYP" = "xfs" ]; then
+       alloc_sz="$(_get_file_block_size $SCRATCH_MNT)"
+       $XFS_IO_PROG -c "extsize $alloc_sz" $SCRATCH_MNT >> $seqres.full
+fi
+
 testfile1=$SCRATCH_MNT/testfile1
 testfile2=$SCRATCH_MNT/testfile2