From: Zorro Lang <zlang@kernel.org>
To: fstests@vger.kernel.org
Cc: djwong@kernel.org, linux-xfs@vger.kernel.org
Subject: [PATCH v2] xfs: new test for randomly fail async buffer writes
Date: Thu, 27 Oct 2022 23:47:11 +0800 [thread overview]
Message-ID: <20221027154711.1458119-1-zlang@kernel.org> (raw)
Make sure xfs can handle randomly fail async buffer writes, no crash
or hang.
Signed-off-by: Zorro Lang <zlang@kernel.org>
---
Hi,
In V1 patch[1], Darrick pointed out that it's not suit for covering e001873853d8
("xfs: ensure we capture IO errors correctly"). So I changed this case to be an
ordinary xfs buf_ioerror test. How about this method?
Thanks,
Zorro
[1]
https://lore.kernel.org/fstests/20221027022459.5ewhsm7gjq5iynra@zlang-mailbox/T/#m856a77c4bb5a61191afeb378b1178f1691ffb8f8
tests/xfs/554 | 49 +++++++++++++++++++++++++++++++++++++++++++++++
tests/xfs/554.out | 4 ++++
2 files changed, 53 insertions(+)
create mode 100755 tests/xfs/554
create mode 100644 tests/xfs/554.out
diff --git a/tests/xfs/554 b/tests/xfs/554
new file mode 100755
index 00000000..1135f4f3
--- /dev/null
+++ b/tests/xfs/554
@@ -0,0 +1,49 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022 Red Hat, Inc. All Rights Reserved.
+#
+# FS QA Test 554
+#
+# Make sure xfs can handle randomly fail async buffer writes, no crash or hang.
+#
+. ./common/preamble
+_begin_fstest auto eio
+
+_cleanup()
+{
+ $KILLALL_PROG -q fsstress 2> /dev/null
+ # ensures all fsstress processes died
+ wait
+ cd /
+ rm -r -f $tmp.*
+}
+
+# Import common functions.
+. ./common/inject
+
+# real QA test starts here
+_supported_fs xfs
+_require_command "$KILLALL_PROG" "killall"
+_require_scratch
+_require_xfs_debug
+_require_xfs_io_error_injection "buf_ioerror"
+_require_aio
+
+_scratch_mkfs >> $seqres.full
+_scratch_mount
+
+echo "Inject buf ioerror tag"
+_scratch_inject_error buf_ioerror
+
+echo "Random I/Os testing (aio sync and write mainly) ..."
+$FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 10000 -p 100 \
+ -f creat=1000 -f afsync=1000 -f awrite=3000 -l 0 >> $seqres.full 2>&1 &
+for ((i=0; i < 6 * TIME_FACTOR; i++));do
+ echo 3 > /proc/sys/vm/drop_caches
+ sleep 10
+done
+
+echo "No hang or panic"
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/554.out b/tests/xfs/554.out
new file mode 100644
index 00000000..99eca3f0
--- /dev/null
+++ b/tests/xfs/554.out
@@ -0,0 +1,4 @@
+QA output created by 554
+Inject buf ioerror tag
+Random I/Os testing (aio sync and write mainly) ...
+No hang or panic
--
2.31.1
reply other threads:[~2022-10-27 15:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221027154711.1458119-1-zlang@kernel.org \
--to=zlang@kernel.org \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox