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
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2007 Silicon Graphics, Inc. All Rights Reserved.
15 #-----------------------------------------------------------------------
18 owner=tes@puffy.melbourne.sgi.com
21 echo "QA output created by $seq"
25 status=1 # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
36 tee -a $seq.full | sed 's/ops;.*/ops/'
40 # 1: [128..199]: 212280..212351 0 (212280..212351) 72 10000
45 awk '$3 ~ /hole/ { print $1, $2, $3; next }
46 $7 ~ /10000/ { print $1, $2, "unwritten"; next }
47 {print $1, $2}' >> $seq.full
51 # get standard environment, filters and checks
55 # real QA test starts here
57 # Modify as appropriate.
58 _supported_fs xfs udf nfs
59 _supported_os IRIX Linux
61 testfile=$TEST_DIR/file.$seq
68 -c 'pwrite -b 50k 0 50k' \
70 -c 'pread -b 200k 0 200k' \
71 $testfile | _filter_io
72 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
75 # on an odd byte boundary => 1 short of boundary
77 boundary_minus1=`expr 100 \* 1024 - 1`
78 echo "boundary_minus1 = $boundary_minus1"
80 -c 'pwrite -b 50k 0 50k' \
81 -c "truncate $boundary_minus1" \
82 -c 'pread -b 200k 0 200k' \
83 $testfile | _filter_io
84 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
87 # on an odd byte boundary => 1 over boundary
89 echo "boundary_plus1 = $boundary_plus1"
90 boundary_plus1=`expr 100 \* 1024 + 1`
92 -c 'pwrite -b 50k 0 50k' \
93 -c "truncate $boundary_plus1" \
94 -c 'pread -b 200k 0 200k' \
95 $testfile | _filter_io
96 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
100 _test_eof_unwritten_extent()
107 -c 'pwrite -b 50k 0 50k' \
108 -c 'pread -b 200k 0 200k' \
109 $testfile | _filter_io
110 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
113 # on an odd byte boundary => 1 short of boundary
115 boundary_minus1=`expr 100 \* 1024 - 1`
116 echo "boundary_minus1 = $boundary_minus1"
118 -c "resvsp 0 $boundary_minus1" \
119 -c "truncate $boundary_minus1" \
120 -c 'pwrite -b 50k 0 50k' \
121 -c 'pread -b 200k 0 200k' \
122 $testfile | _filter_io
123 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
126 # on an odd byte boundary => 1 over boundary
128 boundary_plus1=`expr 100 \* 1024 + 1`
129 echo "boundary_plus1 = $boundary_plus1"
131 -c "resvsp 0 $boundary_plus1" \
132 -c "truncate $boundary_plus1" \
133 -c 'pwrite -b 50k 0 50k' \
134 -c 'pread -b 200k 0 200k' \
135 $testfile | _filter_io
136 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
141 _test_eof_unwritten_extent