generic: test for non-zero used blocks while writing into a file
[xfstests-dev.git] / tests / generic / 114
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 114
6 #
7 # Test races while extending past EOF via sub-block AIO writes
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $TEST_DIR/tst-aio-dio-eof-race
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 _supported_fs generic
29
30 _require_test
31 _require_sparse_files
32 _require_aiodio aio-dio-eof-race
33
34 # Test does 512 byte DIO, so make sure that'll work
35 logical_block_size=`_min_dio_alignment $TEST_DEV`
36
37 if [ "$logical_block_size" -gt "512" ]; then
38         _notrun "device block size: $logical_block_size greater than 512"
39 fi
40
41 # We don't mind 512-byte fs blocks; the IOs won't be sub-block,
42 # but the test should still pass, even if it doesn't stress the code
43 # we're targeting.
44
45 # Note, this test does several extending loops internally
46 $AIO_TEST $TEST_DIR/tst-aio-dio-eof-race
47
48 status=$?
49 exit