diff mbox series

[v2] xfs: new test for randomly fail async buffer writes

Message ID 20221027154711.1458119-1-zlang@kernel.org (mailing list archive)
State New, archived
Headers show
Series [v2] xfs: new test for randomly fail async buffer writes | expand

Commit Message

Zorro Lang Oct. 27, 2022, 3:47 p.m. UTC
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 mbox series

Patch

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