2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Eric Sandeen. All Rights Reserved.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
22 trap "_cleanup ; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
28 # real QA test starts here
32 _require_xfs_io_command "falloc"
38 for SUNIT_K in 8 16 32 64 128; do
39 let SUNIT_BYTES=$SUNIT_K*1024
40 let SUNIT_BLOCKS=$SUNIT_BYTES/$BLOCKSIZE
42 echo "=== mkfs with su $SUNIT_BLOCKS blocks x 4 ==="
43 _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1
46 # This test checks for stripe alignments of space allocations on the
47 # filesystem. Make sure all files get created on the main device,
48 # which for XFS means no rt files.
49 test "$FSTYP" = "xfs" && $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT
51 for SIZE_MULT in 1 2 8 64 256; do
52 let SIZE=$SIZE_MULT*$SUNIT_BYTES
54 echo "=== Testing size ${SIZE_MULT}*${SUNIT_K}k on ${SUNIT_K}k stripe ==="
55 for FILE in 1 2 3 4; do
56 $XFS_IO_PROG -f -c "falloc 0 $SIZE" \
57 $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
59 $XFS_IO_PROG -f -c "pwrite -b $SIZE 0 $SIZE" \
60 $SCRATCH_MNT/file-$FILE-$SIZE-write \
62 $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-falloc \
63 $SUNIT_BLOCKS | _filter_scratch
64 $here/src/t_stripealign $SCRATCH_MNT/file-$FILE-$SIZE-write \
65 $SUNIT_BLOCKS | _filter_scratch
69 echo "=== Testing size 1g falloc on ${SUNIT_K}k stripe ==="
70 $XFS_IO_PROG -f -c "falloc 0 1g" \
71 $SCRATCH_MNT/file-1g-falloc >> $seqres.full 2>&1
72 $here/src/t_stripealign $SCRATCH_MNT/file-1g-falloc $SUNIT_BLOCKS \
75 rm -f $SCRATCH_MNT/file-1g-falloc | _filter_scratch
77 echo "=== Testing size 1073745920 falloc on ${SUNIT_K}k stripe ==="
78 $XFS_IO_PROG -f -c "falloc 0 1073745920" \
79 $SCRATCH_MNT/file-1073745920-falloc >> $seqres.full 2>&1
80 $here/src/t_stripealign $SCRATCH_MNT/file-1073745920-falloc \
81 $SUNIT_BLOCKS | _filter_scratch