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
46 awk '$3 ~ /hole/ { print $1, $2, $3; next }
47 $7 ~ /10000/ { print $1, $2, "unwritten"; next }
52 # get standard environment, filters and checks
56 # real QA test starts here
58 # Modify as appropriate.
59 _supported_fs xfs udf nfs
60 _supported_os IRIX Linux
62 testfile=$TEST_DIR/file.$seq
68 xfs_io -f -c 'pwrite 0 50k' -c 'truncate 100k'\
69 -c 'pread -b 200k 0 200k' $testfile | _filter_io
70 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
73 # on an odd byte boundary => 1 short of boundary
74 boundary_minus1=`expr 100 \* 1024 - 1`
75 echo "boundary_minus1 = $boundary_minus1"
76 xfs_io -f -c 'pwrite 0 50k' -c "truncate $boundary_minus1" \
77 -c 'pread -b 200k 0 200k' $testfile | _filter_io
78 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
81 # on an odd byte boundary => 1 over boundary
82 echo "boundary_plus1 = $boundary_plus1"
83 boundary_plus1=`expr 100 \* 1024 + 1`
84 xfs_io -f -c 'pwrite 0 50k' -c "truncate $boundary_plus1" \
85 -c 'pread -b 200k 0 200k' $testfile | _filter_io
86 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
90 _test_eof_unwritten_extent()
93 xfs_io -f -c 'resvsp 0 100k' -c 'pwrite 0 50k' \
94 -c 'pread -b 200k 0 200k' $testfile | _filter_io
95 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
98 # on an odd byte boundary => 1 short of boundary
99 boundary_minus1=`expr 100 \* 1024 - 1`
100 echo "boundary_minus1 = $boundary_minus1"
101 xfs_io -f -c "resvsp 0 $boundary_minus1" -c 'pwrite 0 50k' \
102 -c 'pread -b 200k 0 200k' $testfile | _filter_io
103 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
106 # on an odd byte boundary => 1 over boundary
107 boundary_plus1=`expr 100 \* 1024 + 1`
108 echo "boundary_plus1 = $boundary_plus1"
109 xfs_io -f -c "resvsp 0 $boundary_plus1" -c 'pwrite 0 50k' \
110 -c 'pread -b 200k 0 200k' $testfile | _filter_io
111 xfs_io -c 'bmap -vp' $testfile | _filter_bmap
116 _test_eof_unwritten_extent