4 # Makes calls to XFS_IOC_ZERO_RANGE and checks tossed ranges
6 # Nothing should be tossed unless the range includes a page boundry
8 # Primarily tests page boundries and boundries that are
9 # off-by-one to ensure we're only tossing what's expected
11 #-----------------------------------------------------------------------
12 # Copyright (c) 2012 SGI. All Rights Reserved.
14 # This program is free software; you can redistribute it and/or
15 # modify it under the terms of the GNU General Public License as
16 # published by the Free Software Foundation.
18 # This program is distributed in the hope that it would be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 # GNU General Public License for more details.
23 # You should have received a copy of the GNU General Public License
24 # along with this program; if not, write the Free Software Foundation,
25 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #-----------------------------------------------------------------------
30 seqres=$RESULT_DIR/$seq
31 seqres=$RESULT_DIR/$seq
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
37 status=1 # failure is the default!
38 trap "exit \$status" 0 1 2 3 15
40 # get standard environment, filters and checks
44 # real QA test starts here
46 # Modify as appropriate.
52 testfile=$TEST_DIR/290.$$
59 $XFS_IO_PROG -f -t -c "pwrite -S 0x41 0 4096" \
60 -c "pwrite -S 0x42 4096 4096" \
61 -c "zero $zero_start $zero_len" \
62 -c "pread -v 0 8192" \
63 $testfile | _filter_xfs_io_unique
66 # [0,1] -- Shouldn't toss anything
69 #[0,4095] -- Shouldn't toss anything
72 #[0,4096] -- Should toss first page
75 #[0,4097] -- Should toss first page
78 #[4095,8191] -- Should toss last byte of first page
81 #[4095,8192] -- Should toss second page & last byte of first page
84 #[4095,8193] -- Should toss second page & last byte of first page
87 #[4096,8192] -- Should toss second page
90 #[1024,5120] -- Should toss from 1024 to end of first page