4 # Test out reallocation of the extent array in xfs_io.
5 # Based on a testcase from Tomasz Majkowski <moosh009@gmail.com>.
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2009 Christoph Hellwig.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 echo "QA output created by $seq"
30 status=1 # failure is the default!
37 let fsize=$(($writes * 0x100000))
39 # prevent EOF preallocation from affecting results
40 xfs_io -f $file -c "truncate $fsize"
43 for i in `seq 0 $writes`; do
44 xfs_io -f $file -c "pwrite -q $offset 64k"
45 let offset=$offset+0x100000
54 awk '$3 ~ /hole/ { print $1, $2, $3; next }
60 rm -f $SCRATCH_MNT/r??
62 trap "_cleanup; exit \$status" 0 1 2 3 15
66 # get standard environment, filters and checks
70 # real QA test starts here
74 _scratch_mkfs > /dev/null 2>&1
75 _scratch_mount > /dev/null 2>&1
77 for i in 10 14 15 16 17 28 29 30 31; do
78 rm -f $SCRATCH_MNT/hole_file
79 _write_holes $SCRATCH_MNT/hole_file${i} ${i}
82 for i in 10 14 15 16 17 28 29 30 31; do
83 xfs_bmap $SCRATCH_MNT/hole_file${i} | _filter_bmap