summaryrefslogtreecommitdiff
path: root/tests/btrfs/207
blob: fc18b17f67c28b80cb64a0b104dbfeb152ac4825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 Facebook.  All Rights Reserved.
#
# FS QA Test 207
#
# Test large DIO reads and writes with various profiles. Regression test for
# patch "btrfs: fix RAID direct I/O reads with alternate csums".
#
. ./common/preamble
_begin_fstest auto rw raid

. ./common/filter

_supported_fs btrfs
# we check scratch dev after each loop
_require_scratch_nocheck
_require_scratch_dev_pool 4
_btrfs_get_profile_configs

for mkfs_opts in "${_btrfs_profile_configs[@]}"; do
	echo "Test $mkfs_opts" >>$seqres.full
	_scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
	_scratch_mount >>$seqres.full 2>&1

	dd if=/dev/urandom of="$SCRATCH_MNT/$seq" \
		bs=1M count=64 conv=fsync status=none
	dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.dioread" \
		bs=1M iflag=direct status=none
	dd if="$SCRATCH_MNT/$seq" of="$SCRATCH_MNT/$seq.diowrite" \
		bs=1M oflag=direct status=none
	diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.dioread" |
		tee -a $seqres.full
	diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.diowrite" |
		tee -a $seqres.full

	_scratch_unmount
	_check_scratch_fs
done

echo "Silence is golden"

status=0
exit