2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Facebook. All Rights Reserved.
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".
11 _begin_fstest auto rw raid
13 # Import common functions.
17 # we check scratch dev after each loop
18 _require_scratch_nocheck
19 _require_scratch_dev_pool 4
20 _btrfs_get_profile_configs
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
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" |
35 diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.diowrite" |
42 echo "Silence is golden"