4 # To test for short dio reads on IRIX and Linux - pv#962005/962547
5 # http://bugworks.engr.sgi.com/query.cgi/962005
7 # In particular we are interested in dio_reads for the cases of:
9 # * eof on an unwritten extent
10 # * eof on a sector boundary and not on a sector boundary
12 #-----------------------------------------------------------------------
13 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
15 # This program is free software; you can redistribute it and/or
16 # modify it under the terms of the GNU General Public License as
17 # published by the Free Software Foundation.
19 # This program is distributed in the hope that it would be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License
25 # along with this program; if not, write the Free Software Foundation,
26 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #-----------------------------------------------------------------------
31 owner=tes@puffy.melbourne.sgi.com
34 echo "QA output created by $seq"
38 status=1 # failure is the default!
39 trap "_cleanup; exit \$status" 0 1 2 3 15
49 tee -a $seq.full | sed 's/ops;.*/ops/'
53 # 1: [128..199]: 212280..212351 0 (212280..212351) 72 10000
58 awk '$3 ~ /hole/ { print $1, $2, $3; next }
59 $7 ~ /10000/ { print $1, $2, "unwritten"; next }
60 {print $1, $2}' >> $seq.full
64 # get standard environment, filters and checks
68 # real QA test starts here
70 # Modify as appropriate.
72 _supported_os IRIX Linux
74 testfile=$TEST_DIR/file.$seq
81 -c 'pwrite -b 52k 0 52k' \
83 -c 'pread -b 200k 0 200k' \
84 $testfile | _filter_io
85 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
88 # on an odd byte boundary => 1 short of boundary
90 boundary_minus1=`expr 100 \* 1024 - 1`
91 echo "boundary_minus1 = $boundary_minus1"
93 -c 'pwrite -b 52k 0 52k' \
94 -c "truncate $boundary_minus1" \
95 -c 'pread -b 200k 0 200k' \
96 $testfile | _filter_io
97 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
100 # on an odd byte boundary => 1 over boundary
102 boundary_plus1=`expr 100 \* 1024 + 1`
103 echo "boundary_plus1 = $boundary_plus1"
105 -c 'pwrite -b 52k 0 52k' \
106 -c "truncate $boundary_plus1" \
107 -c 'pread -b 200k 0 200k' \
108 $testfile | _filter_io
109 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
113 _test_eof_unwritten_extent()
120 -c 'pwrite -b 52k 0 52k' \
121 -c 'pread -b 200k 0 200k' \
122 $testfile | _filter_io
123 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
126 # on an odd byte boundary => 1 short of boundary
128 boundary_minus1=`expr 100 \* 1024 - 1`
129 echo "boundary_minus1 = $boundary_minus1"
131 -c "resvsp 0 $boundary_minus1" \
132 -c "truncate $boundary_minus1" \
133 -c 'pwrite -b 52k 0 52k' \
134 -c 'pread -b 200k 0 200k' \
135 $testfile | _filter_io
136 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
139 # on an odd byte boundary => 1 over boundary
141 boundary_plus1=`expr 100 \* 1024 + 1`
142 echo "boundary_plus1 = $boundary_plus1"
144 -c "resvsp 0 $boundary_plus1" \
145 -c "truncate $boundary_plus1" \
146 -c 'pwrite -b 52k 0 52k' \
147 -c 'pread -b 200k 0 200k' \
148 $testfile | _filter_io
149 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
154 _test_eof_unwritten_extent