2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Eric Sandeen. All Rights Reserved.
10 _begin_fstest auto quick
12 # Import common functions.
15 # real QA test starts here
19 _require_xfs_io_command "falloc"
23 for SUNIT_K in 8 16 32 64 128; do
24 let SUNIT_BYTES=$SUNIT_K*1024
25 let SUNIT_BLOCKS=$SUNIT_BYTES/$BLOCKSIZE
27 echo "=== mkfs with su $SUNIT_BLOCKS blocks x 4 ==="
28 _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
31 # This test checks for stripe alignments of space allocations on the
32 # filesystem. Make sure all files get created on the main device,
33 # which for XFS means no rt files.
34 test "$FSTYP" = "xfs" && \
35 _xfs_force_bdev data $SCRATCH_MNT
37 for SIZE_MULT in 1 2 8 64 256; do
38 let SIZE=$SIZE_MULT*$SUNIT_BYTES
40 echo "=== Testing size ${SIZE_MULT}*${SUNIT_K}k on ${SUNIT_K}k stripe ==="
41 for FILE in 1 2 3 4; do
42 $XFS_IO_PROG -f -c "falloc 0 $SIZE" \
43 $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
45 $XFS_IO_PROG -f -c "pwrite -b $SIZE 0 $SIZE" \
46 $SCRATCH_MNT/file-$FILE-$SIZE-write \
48 $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
49 $SUNIT_BLOCKS | _filter_scratch
50 $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-write \
51 $SUNIT_BLOCKS | _filter_scratch
55 echo "=== Testing size 1g falloc on ${SUNIT_K}k stripe ==="
56 $XFS_IO_PROG -f -c "falloc 0 1g" \
57 $SCRATCH_MNT/file-1g-falloc >> $seqres.full 2>&1
58 $here/src/t_stripealign $SCRATCH_MNT/file-1g-falloc $SUNIT_BLOCKS \
61 rm -f $SCRATCH_MNT/file-1g-falloc | _filter_scratch
63 echo "=== Testing size 1073745920 falloc on ${SUNIT_K}k stripe ==="
64 $XFS_IO_PROG -f -c "falloc 0 1073745920" \
65 $SCRATCH_MNT/file-1073745920-falloc >> $seqres.full 2>&1
66 $here/src/t_stripealign $SCRATCH_MNT/file-1073745920-falloc \
67 $SUNIT_BLOCKS | _filter_scratch