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 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
33 # we check scratch dev after each loop
34 _require_scratch_nocheck
35 _require_scratch_dev_pool 4
36 _btrfs_get_profile_configs
38 for mkfs_opts in "${_btrfs_profile_configs[@]}"; do
39 echo "Test $mkfs_opts" >>$seqres.full
40 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
41 _scratch_mount >>$seqres.full 2>&1
43 dd if=/dev/urandom of="$SCRATCH_MNT/$seq" \
44 bs=1M count=64 conv=fsync status=none
45 dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.dioread" \
46 bs=1M iflag=direct status=none
47 dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.diowrite" \
48 bs=1M oflag=direct status=none
49 diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.dioread" |
51 diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.diowrite" |
58 echo "Silence is golden"