3 #-----------------------------------------------------------------------
4 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # To test for short dio reads on IRIX and Linux - pv#962005/962547
24 # http://bugworks.engr.sgi.com/query.cgi/962005
26 # In particular we are interested in dio_reads for the cases of:
28 # * eof on an unwritten extent
29 # * eof on a sector boundary and not on a sector boundary
33 owner=tes@puffy.melbourne.sgi.com
36 echo "QA output created by $seq"
40 status=1 # failure is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
51 tee -a $seq.full | sed 's/ops;.*/ops/'
55 # 1: [128..199]: 212280..212351 0 (212280..212351) 72 10000
60 awk '$3 ~ /hole/ { print $1, $2, $3; next }
61 $7 ~ /10000/ { print $1, $2, "unwritten"; next }
62 {print $1, $2}' >> $seq.full
66 # get standard environment, filters and checks
70 # real QA test starts here
72 # Modify as appropriate.
74 _supported_os IRIX Linux
76 testfile=$TEST_DIR/file.$seq
83 -c 'pwrite -b 50k 0 50k' \
85 -c 'pread -b 200k 0 200k' \
86 $testfile | _filter_io
87 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
90 # on an odd byte boundary => 1 short of boundary
92 boundary_minus1=`expr 100 \* 1024 - 1`
93 echo "boundary_minus1 = $boundary_minus1"
95 -c 'pwrite -b 50k 0 50k' \
96 -c "truncate $boundary_minus1" \
97 -c 'pread -b 200k 0 200k' \
98 $testfile | _filter_io
99 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
102 # on an odd byte boundary => 1 over boundary
104 boundary_plus1=`expr 100 \* 1024 + 1`
105 echo "boundary_plus1 = $boundary_plus1"
107 -c 'pwrite -b 50k 0 50k' \
108 -c "truncate $boundary_plus1" \
109 -c 'pread -b 200k 0 200k' \
110 $testfile | _filter_io
111 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
115 _test_eof_unwritten_extent()
122 -c 'pwrite -b 50k 0 50k' \
123 -c 'pread -b 200k 0 200k' \
124 $testfile | _filter_io
125 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
128 # on an odd byte boundary => 1 short of boundary
130 boundary_minus1=`expr 100 \* 1024 - 1`
131 echo "boundary_minus1 = $boundary_minus1"
133 -c "resvsp 0 $boundary_minus1" \
134 -c "truncate $boundary_minus1" \
135 -c 'pwrite -b 50k 0 50k' \
136 -c 'pread -b 200k 0 200k' \
137 $testfile | _filter_io
138 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
141 # on an odd byte boundary => 1 over boundary
143 boundary_plus1=`expr 100 \* 1024 + 1`
144 echo "boundary_plus1 = $boundary_plus1"
146 -c "resvsp 0 $boundary_plus1" \
147 -c "truncate $boundary_plus1" \
148 -c 'pwrite -b 50k 0 50k' \
149 -c 'pread -b 200k 0 200k' \
150 $testfile | _filter_io
151 $XFS_IO_PROG -c 'bmap -vp' $testfile | _filter_bmap
156 _test_eof_unwritten_extent