generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 465
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Alibaba Group.  All Rights Reserved.
4 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
5 #
6 # FS QA Test No. 465
7 #
8 # Test i_size is updated properly under dio read/write
9 #
10 . ./common/preamble
11 _begin_fstest auto rw quick aio
12
13 # Override the default cleanup function.
14 _cleanup()
15 {
16         cd /
17         rm -f $tmp.* $testfile.*
18 }
19
20 # Import common functions.
21 . ./common/filter
22
23 # real QA test starts here
24 _supported_fs generic
25
26 _require_aiodio aio-dio-append-write-read-race
27 _require_test_program "feature"
28
29 testfile=$TEST_DIR/$seq.$$
30 min_dio_align=`_min_dio_alignment $TEST_DEV`
31 page_size=`$here/src/feature -s`
32
33 echo "non-aio dio test"
34 align=$min_dio_align
35 while [ $align -le $page_size ]; do
36         echo "$AIO_TEST -a $align -d $testfile.$align" >> $seqres.full
37         $AIO_TEST -a $align -d $testfile.$align 2>&1 | tee -a $seqres.full
38         align=$((align * 2))
39 done
40
41 echo "aio-dio test"
42 align=$min_dio_align
43 while [ $align -le $page_size ]; do
44         echo "$AIO_TEST -a $align $testfile.$align" >> $seqres.full
45         $AIO_TEST -a $align $testfile.$align 2>&1 | tee -a $seqres.full
46         align=$((align * 2))
47 done
48
49 # success, all done
50 status=0
51 exit