generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 406
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Liu Bo.  All Rights Reserved.
4 #
5 # FS QA Test generic/406
6 #
7 # If a larger dio write (size >= 128M) got splitted, the assertion in endio
8 # would complain (CONFIG_BTRFS_ASSERT is required).
9 #
10 # Regression test for
11 #   Btrfs: adjust outstanding_extents counter properly when dio write is split
12 #
13 . ./common/preamble
14 _begin_fstest auto quick
15
16 # Import common functions.
17 . ./common/filter
18
19 # real QA test starts here
20
21 # Modify as appropriate.
22 _supported_fs generic
23 _require_scratch
24 _require_odirect
25
26 _scratch_mkfs >> $seqres.full 2>&1
27 _scratch_mount
28
29 # 2G / 1K
30 blocksize=$(( (128 + 1) * 2 * 1024 * 1024))
31 fsblock=$(( (128 + 1) * 2 * 1024))
32 _require_fs_space $SCRATCH_MNT $fsblock
33
34 echo "Silence is golden"
35
36 $XFS_IO_PROG -f -d -c "pwrite -b ${blocksize} 0 ${blocksize}" $SCRATCH_MNT/testfile.$seq >> $seqres.full 2>&1
37
38 _scratch_unmount
39
40 # success, all done
41 status=0
42 exit