2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
7 # Test out prealloc, direct writes and buffered read
8 # Some experimentation when looking at
9 # pv#962014 - DMF 3.7 reading incorrect data
10 # Doesn't actually reproduce the problem but it tried to :-)
13 _begin_fstest rw pattern auto prealloc quick
17 tee -a $seqres.full | _filter_xfs_io
21 # < 1: [8..79]: 6552..6623 0 (6552..6623) 72
22 # > 1: [8..79]: 202544..202615 0 (202544..202615) 72
26 awk '$3 ~ /hole/ { print $1, $2, $3; next }
27 {print $1, $2}' >> $seqres.full
30 # Import common functions.
33 # real QA test starts here
35 # Modify as appropriate.
38 _require_xfs_io_command "falloc"
41 testfile=$TEST_DIR/file.$seq
47 #$XFS_IO_PROG -f -c "resvsp ${off}k ${end}k" $testfile
49 # write the initial file
50 $XFS_IO_PROG -f -c "pwrite 0 ${end}k" $testfile | _filter_io
53 while [ $off -le $end ]
58 $XFS_IO_PROG -c "unresvsp $offset $length" -c "bmap -vp" $testfile | _filter_bmap
60 let off=$off+$len # skip over 1
65 while [ $off -le $end ]
71 echo "*** offset = $offset ***"
75 $XFS_IO_PROG -d -c "resvsp $offset $length" -c "pwrite -b $bufsize $offset $length" $testfile | _filter_io
78 #$XFS_IO_PROG -c "resvsp $offset $length" $testfile
79 #xfs_bmap -v -p $testfile
80 #$XFS_IO_PROG -d -c "pwrite -b $bufsize $offset $length" $testfile
81 #xfs_bmap -v -p $testfile
83 $XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile >$tmp.$off &
86 #$XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile
89 let off=$off+$len # skip over 1
94 cat $tmp.* | _filter_io