2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.
7 # Test out reallocation of the extent array in xfs_io.
8 # Based on a testcase from Tomasz Majkowski <moosh009@gmail.com>.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
23 let fsize=$(($writes * 0x100000))
25 # prevent EOF preallocation from affecting results
26 $XFS_IO_PROG -f $file -c "truncate $fsize"
29 for i in `seq 0 $writes`; do
30 $XFS_IO_PROG -f $file -c "pwrite -b 64k -q $offset 64k"
31 let offset=$offset+0x100000
40 awk '$3 ~ /hole/ { print $1, $2, $3; next }
46 rm -f $SCRATCH_MNT/r??
48 trap "_cleanup; exit \$status" 0 1 2 3 15
52 # get standard environment, filters and checks
56 # real QA test starts here
59 _scratch_mkfs > /dev/null 2>&1
60 _scratch_mount > /dev/null 2>&1
62 for i in 10 14 15 16 17 28 29 30 31; do
63 rm -f $SCRATCH_MNT/hole_file
64 _write_holes $SCRATCH_MNT/hole_file${i} ${i}
67 for i in 10 14 15 16 17 28 29 30 31; do
68 xfs_bmap $SCRATCH_MNT/hole_file${i} | _filter_bmap