]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: test xfs_healer can report filesystem shutdowns
authorDarrick J. Wong <djwong@kernel.org>
Tue, 10 Mar 2026 03:52:28 +0000 (20:52 -0700)
committerZorro Lang <zlang@kernel.org>
Tue, 17 Mar 2026 03:31:44 +0000 (11:31 +0800)
Make sure that xfs_healer can actually report abnormal filesystem shutdowns.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/661 [new file with mode: 0755]
tests/xfs/661.out [new file with mode: 0755]

diff --git a/tests/xfs/661 b/tests/xfs/661
new file mode 100755 (executable)
index 0000000..f3f74cf
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2024-2026 Oracle.  All Rights Reserved.
+#
+# FS QA Test No. 661
+#
+# Check that xfs_healer can report filesystem shutdowns.
+
+. ./common/preamble
+_begin_fstest auto quick scrub eio selfhealing shutdown
+
+. ./common/fuzzy
+. ./common/filter
+. ./common/systemd
+
+_require_scratch_nocheck
+_require_scrub
+_require_command "$XFS_HEALER_PROG" "xfs_healer"
+
+_scratch_mkfs >> $seqres.full
+_scratch_mount
+_require_xfs_healer $SCRATCH_MNT
+$XFS_IO_PROG -f -c "pwrite -S 0x58 0 500k" -c "fsync" $victim >> $seqres.full
+
+echo "Start healer and shut down"
+_scratch_invoke_xfs_healer "$tmp.healer"
+_scratch_shutdown -f
+
+# Unmount filesystem to start fresh
+echo "Kill healer"
+_scratch_kill_xfs_healer
+cat $tmp.healer >> $seqres.full
+cat $tmp.healer | _filter_scratch | grep 'shut down'
+
+# success, all done
+_exit 0
diff --git a/tests/xfs/661.out b/tests/xfs/661.out
new file mode 100755 (executable)
index 0000000..5ec782d
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 661
+Start healer and shut down
+Kill healer
+SCRATCH_MNT: filesystem shut down due to forced unmount