]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: filter internal errors during io error testing
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Aug 2022 04:22:40 +0000 (21:22 -0700)
committerZorro Lang <zlang@kernel.org>
Sun, 4 Sep 2022 13:44:05 +0000 (21:44 +0800)
The goal of an EIO shutdown test is to examine the shutdown and recovery
behavior if we make the underlying storage device return EIO.  On XFS,
it's possible that the shutdown will come from a thread that cancels a
dirty transaction due to the EIO.  This is expected behavior, but
_check_dmesg will flag it as a test failure.

Make it so that we can add simple regexps to the default check_dmesg
filter function, then add the "Internal error" string to filter function
when we invoke an EIO test.  This fixes periodic regressions in
generic/019 and generic/475.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
check
common/rc
common/xfs

diff --git a/check b/check
index 0b2f10ed4dd2573a5b8eea86fc58991d9be02916..000e31cb2673ed3182fdb52d95a6b7670eb6eb48 100755 (executable)
--- a/check
+++ b/check
@@ -896,6 +896,7 @@ function run_section()
                        echo "run fstests $seqnum at $date_time" > /dev/kmsg
                        # _check_dmesg depends on this log in dmesg
                        touch ${RESULT_DIR}/check_dmesg
+                       rm -f ${RESULT_DIR}/dmesg_filter
                fi
                _try_wipe_scratch_devs > /dev/null 2>&1
 
index 277678850aa7f8ae6137998da8848e7e44eef8fc..a25cbcd0911e2287af8acb98435476fc99e47ae6 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4171,8 +4171,25 @@ _check_dmesg_for()
 # lockdep.
 _check_dmesg_filter()
 {
+       local extra_filter=
+       local filter_file="${RESULT_DIR}/dmesg_filter"
+
+       test -e "$filter_file" && extra_filter="-f $filter_file"
+
        egrep -v -e "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low" \
-               -e "BUG: MAX_STACK_TRACE_ENTRIES too low"
+               -e "BUG: MAX_STACK_TRACE_ENTRIES too low" \
+               $extra_filter
+}
+
+# Add a simple expression to the default dmesg filter
+_add_dmesg_filter()
+{
+       local regexp="$1"
+       local filter_file="${RESULT_DIR}/dmesg_filter"
+
+       if [ ! -e "$filter_file" ] || ! grep -q "$regexp" "$filter_file"; then
+               echo "$regexp" >> "${RESULT_DIR}/dmesg_filter"
+       fi
 }
 
 # check dmesg log for WARNING/Oops/etc.
index 65234c8baeb6dc91334d2d58e83de94783c24a9d..ae81b3fe45e0e6f785e4bc9ac82315399f0a081e 100644 (file)
@@ -841,6 +841,13 @@ _xfs_prepare_for_eio_shutdown()
        local dev="$1"
        local ctlfile="error/fail_at_unmount"
 
+       # Once we enable IO errors, it's possible that a writer thread will
+       # trip over EIO, cancel the transaction, and shut down the system.
+       # This is expected behavior, so we need to remove the "Internal error"
+       # message from the list of things that can cause the test to be marked
+       # as failed.
+       _add_dmesg_filter "Internal error"
+
        # Don't retry any writes during the (presumably) post-shutdown unmount
        _has_fs_sysfs "$ctlfile" && _set_fs_sysfs_attr $dev "$ctlfile" 1