xfs: new test for randomly fail async buffer writes
PATCH v2 1/1 xfs: new test for randomly fail async buffer writes
Make sure xfs can handle randomly fail async buffer writes, no crash or hang.
Signed-off-by Zorro Lang <[email protected]>
---
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
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
tests/xfs/554 new file +49 -0
@@ -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
tests/xfs/554.out new file +4 -0
@@ -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
Signature · 1 line
2.31.1