FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID
@ 2020-03-02 22:08 Omar Sandoval
  2020-03-03  2:03 ` Omar Sandoval
  2020-03-03  2:51 ` Josef Bacik
  0 siblings, 2 replies; 3+ messages in thread
From: Omar Sandoval @ 2020-03-02 22:08 UTC (permalink / raw)
  To: fstests, linux-btrfs; +Cc: kernel-team

From: Omar Sandoval <osandov@fb.com>

Apparently we don't have any tests which exercise the code path in Btrfs
that has to split up direct I/Os for RAID stripes. Add one to catch the
bug fixed by "btrfs: fix RAID direct I/O reads with alternate csums".
---
I also had to fix up the tests/btrfs/group file, which had a renumbering
issue that was preventing me from adding a new test.

 tests/btrfs/207     | 58 +++++++++++++++++++++++++++++++++++++++++++++
 tests/btrfs/207.out |  2 ++
 tests/btrfs/group   |  3 ++-
 3 files changed, 62 insertions(+), 1 deletion(-)
 create mode 100755 tests/btrfs/207
 create mode 100644 tests/btrfs/207.out

diff --git a/tests/btrfs/207 b/tests/btrfs/207
new file mode 100755
index 00000000..99e57cb8
--- /dev/null
+++ b/tests/btrfs/207
@@ -0,0 +1,58 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 Facebook.  All Rights Reserved.
+#
+# FS QA Test 207
+#
+# Test large DIO reads with various profiles. Regression test for patch "btrfs:
+# fix RAID direct I/O reads with alternate csums".
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+_supported_fs btrfs
+_supported_os Linux
+# 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.copy" \
+		bs=1M iflag=direct status=none
+	diff -q "$SCRATCH_MNT/$seq" "$SCRATCH_MNT/$seq.copy" |
+		tee -a $seqres.full
+
+	_scratch_unmount
+	_check_scratch_fs
+done
+
+echo "Silence is golden"
+
+status=0
+exit
diff --git a/tests/btrfs/207.out b/tests/btrfs/207.out
new file mode 100644
index 00000000..cb8e0e2b
--- /dev/null
+++ b/tests/btrfs/207.out
@@ -0,0 +1,2 @@
+QA output created by 207
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index e3ad347b..c87a042e 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -208,4 +208,5 @@
 203 auto quick send clone
 204 auto quick punch
 205 auto quick clone compress
-204 auto quick log replay
+206 auto quick log replay
+207 auto quick rw raid
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID
  2020-03-02 22:08 [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID Omar Sandoval
@ 2020-03-03  2:03 ` Omar Sandoval
  2020-03-03  2:51 ` Josef Bacik
  1 sibling, 0 replies; 3+ messages in thread
From: Omar Sandoval @ 2020-03-03  2:03 UTC (permalink / raw)
  To: fstests, linux-btrfs; +Cc: kernel-team

On Mon, Mar 02, 2020 at 02:08:45PM -0800, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> Apparently we don't have any tests which exercise the code path in Btrfs
> that has to split up direct I/Os for RAID stripes. Add one to catch the
> bug fixed by "btrfs: fix RAID direct I/O reads with alternate csums".
> ---
> I also had to fix up the tests/btrfs/group file, which had a renumbering
> issue that was preventing me from adding a new test.
> 
>  tests/btrfs/207     | 58 +++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/207.out |  2 ++
>  tests/btrfs/group   |  3 ++-
>  3 files changed, 62 insertions(+), 1 deletion(-)
>  create mode 100755 tests/btrfs/207
>  create mode 100644 tests/btrfs/207.out
> 
> diff --git a/tests/btrfs/207 b/tests/btrfs/207
> new file mode 100755
> index 00000000..99e57cb8
> --- /dev/null
> +++ b/tests/btrfs/207
> @@ -0,0 +1,58 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 Facebook.  All Rights Reserved.
> +#
> +# FS QA Test 207
> +#
> +# Test large DIO reads with various profiles. Regression test for patch "btrfs:
> +# fix RAID direct I/O reads with alternate csums".

Hmm, I might as well make this test also exercise direct I/O writes, not
just reads. I'll send a v2.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID
  2020-03-02 22:08 [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID Omar Sandoval
  2020-03-03  2:03 ` Omar Sandoval
@ 2020-03-03  2:51 ` Josef Bacik
  1 sibling, 0 replies; 3+ messages in thread
From: Josef Bacik @ 2020-03-03  2:51 UTC (permalink / raw)
  To: Omar Sandoval, fstests, linux-btrfs; +Cc: kernel-team

On 3/2/20 5:08 PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> Apparently we don't have any tests which exercise the code path in Btrfs
> that has to split up direct I/Os for RAID stripes. Add one to catch the
> bug fixed by "btrfs: fix RAID direct I/O reads with alternate csums".
> ---

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 22:08 [PATCH fstests] btrfs: add test for large direct I/O reads w/ RAID Omar Sandoval
2020-03-03  2:03 ` Omar Sandoval
2020-03-03  2:51 ` Josef Bacik

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git