2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Red Hat, Inc. All Rights Reserved.
7 # Test that non-block-aligned aio+dio into holes does not leave
8 # zero'd out portions of the file
10 # QEMU IO to a file-backed device with misaligned partitions
11 # can send this sort of IO
13 # This test need only be run in the case where the logical block size
14 # of the device can be smaller than the file system block size.
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
22 status=1 # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
31 # get standard environment, filters and checks
39 _require_aiodio aiodio_sparse2
41 echo "Silence is golden."
43 # real QA test starts here
46 rm -f $TEST_DIR/aiodio_sparse
48 logical_block_size=`_min_dio_alignment $TEST_DEV`
49 fs_block_size=`_get_block_size $TEST_DIR`
50 file_size=$((8 * $fs_block_size))
52 if [ $fs_block_size -le $logical_block_size ]; then
53 _notrun "fs block size must be larger than the device block size. fs block size: $fs_block_size, device block size: $logical_block_size"
56 # 2 threads, fs block sized writes, filesize, stride through file by
57 # fs block size, start at logical block size offset
58 $AIO_TEST -i 2 -w $fs_block_size -s $file_size -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"