generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / btrfs / 207
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Facebook.  All Rights Reserved.
4 #
5 # FS QA Test 207
6 #
7 # Test large DIO reads and writes with various profiles. Regression test for
8 # patch "btrfs: fix RAID direct I/O reads with alternate csums".
9 #
10 . ./common/preamble
11 _begin_fstest auto rw raid
12
13 # Import common functions.
14 . ./common/filter
15
16 _supported_fs btrfs
17 # we check scratch dev after each loop
18 _require_scratch_nocheck
19 _require_scratch_dev_pool 4
20 _btrfs_get_profile_configs
21
22 for mkfs_opts in "${_btrfs_profile_configs[@]}"; do
23         echo "Test $mkfs_opts" >>$seqres.full
24         _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
25         _scratch_mount >>$seqres.full 2>&1
26
27         dd if=/dev/urandom of="$SCRATCH_MNT/$seq" \
28                 bs=1M count=64 conv=fsync status=none
29         dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.dioread" \
30                 bs=1M iflag=direct status=none
31         dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.diowrite" \
32                 bs=1M oflag=direct status=none
33         diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.dioread" |
34                 tee -a $seqres.full
35         diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.diowrite" |
36                 tee -a $seqres.full
37
38         _scratch_unmount
39         _check_scratch_fs
40 done
41
42 echo "Silence is golden"
43
44 status=0
45 exit