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 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
29 tee -a $seqres.full | _filter_xfs_io
33 # < 1: [8..79]: 6552..6623 0 (6552..6623) 72
34 # > 1: [8..79]: 202544..202615 0 (202544..202615) 72
38 awk '$3 ~ /hole/ { print $1, $2, $3; next }
39 {print $1, $2}' >> $seqres.full
42 # get standard environment, filters and checks
46 # real QA test starts here
48 # Modify as appropriate.
51 _require_xfs_io_command "falloc"
54 testfile=$TEST_DIR/file.$seq
61 #$XFS_IO_PROG -f -c "resvsp ${off}k ${end}k" $testfile
63 # write the initial file
64 $XFS_IO_PROG -f -c "pwrite 0 ${end}k" $testfile | _filter_io
67 while [ $off -le $end ]
72 $XFS_IO_PROG -c "unresvsp $offset $length" -c "bmap -vp" $testfile | _filter_bmap
74 let off=$off+$len # skip over 1
79 while [ $off -le $end ]
85 echo "*** offset = $offset ***"
89 $XFS_IO_PROG -d -c "resvsp $offset $length" -c "pwrite -b $bufsize $offset $length" $testfile | _filter_io
92 #$XFS_IO_PROG -c "resvsp $offset $length" $testfile
93 #xfs_bmap -v -p $testfile
94 #$XFS_IO_PROG -d -c "pwrite -b $bufsize $offset $length" $testfile
95 #xfs_bmap -v -p $testfile
97 $XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile >$tmp.$off &
100 #$XFS_IO_PROG -r -c "pread -v -b $bufsize $offset $length" $testfile
103 let off=$off+$len # skip over 1
108 cat $tmp.* | _filter_io