4 # Test that non-block-aligned aio+dio into holes does not leave
5 # zero'd out portions of the file
7 # QEMU IO to a file-backed device with misaligned partitions
8 # can send this sort of IO
10 # This test need only be run in the case where the logical block size
11 # of the device can be smaller than the file system block size.
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2010 Red Hat, Inc. All Rights Reserved.
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 seqres=$RESULT_DIR/$seq
34 seqres=$RESULT_DIR/$seq
35 echo "QA output created by $seq"
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
48 # get standard environment, filters and checks
56 _require_aiodio aiodio_sparse2
58 echo "Silence is golden."
60 # real QA test starts here
63 rm -f $TEST_DIR/aiodio_sparse
65 logical_block_size=`blockdev --getss $TEST_DEV`
66 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
68 if [ $fs_block_size -le $logical_block_size ]; then
69 _notrun "fs block size must be larger than the device block size. fs block size: $fs_block_size, device block size: $logical_block_size"
72 # 2 threads, fs block sized writes, 64k filesize, stride through file by
73 # fs block size, start at logical block size offset
74 $AIO_TEST -i 2 -w $fs_block_size -s 64k -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"