]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: stress test cycling parent pointers with online repair v2023.03.19
authorDarrick J. Wong <djwong@kernel.org>
Wed, 15 Mar 2023 00:58:17 +0000 (17:58 -0700)
committerZorro Lang <zlang@kernel.org>
Thu, 16 Mar 2023 06:21:42 +0000 (14:21 +0800)
Add a couple of new tests to exercise directory and parent pointer
repair against rename() calls moving child subdirectories from one
parent to another.  This is a useful test because it turns out that the
VFS doesn't lock the child subdirectory (it does lock the parents), so
repair must be more careful.

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

index 470bec47da7c3ba4e8ff2db7779314724eab6a3a..961bedc7175e108ca1965d2e15e1beb0d7e4a2ec 100644 (file)
@@ -986,6 +986,20 @@ __stress_scrub_fsstress_loop() {
        local focus=()
 
        case "$stress_tgt" in
+       "parent")
+               focus+=('-z')
+
+               # Create a directory tree very gradually
+               for op in creat link mkdir; do
+                       focus+=('-f' "${op}=2")
+               done
+               focus+=('-f' 'unlink=1' '-f' 'rmdir=1')
+
+               # But do a lot of renames to cycle parent pointers
+               for op in rename rnoreplace rexchange; do
+                       focus+=('-f' "${op}=40")
+               done
+               ;;
        "dir")
                focus+=('-z')
 
@@ -1276,6 +1290,7 @@ __stress_scrub_check_commands() {
 #       'writeonly': Only perform fs updates, no reads.
 #       'symlink': Only create symbolic links.
 #       'mknod': Only create special files.
+#       'parent': Focus on updating parent pointers
 #
 #       The default is 'default' unless XFS_SCRUB_STRESS_TARGET is set.
 # -X   Run this program to exercise the filesystem.  Currently supported
diff --git a/tests/xfs/799 b/tests/xfs/799
new file mode 100755 (executable)
index 0000000..4391686
--- /dev/null
@@ -0,0 +1,38 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2023 Oracle, Inc.  All Rights Reserved.
+#
+# FS QA Test No. 799
+#
+# Race fsstress doing mostly renames and xfs_scrub in force-repair mode for a
+# while to see if we crash or livelock.
+#
+. ./common/preamble
+_begin_fstest online_repair dangerous_fsstress_repair
+
+_cleanup() {
+       cd /
+       _scratch_xfs_stress_scrub_cleanup &> /dev/null
+       rm -r -f $tmp.*
+}
+_register_cleanup "_cleanup" BUS
+
+# Import common functions.
+. ./common/filter
+. ./common/fuzzy
+. ./common/inject
+. ./common/xfs
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_xfs_stress_online_repair
+
+_scratch_mkfs > "$seqres.full" 2>&1
+_scratch_mount
+_scratch_xfs_stress_online_repair -S '-k' -x 'parent'
+
+# success, all done
+echo Silence is golden
+status=0
+exit
diff --git a/tests/xfs/799.out b/tests/xfs/799.out
new file mode 100644 (file)
index 0000000..f3fd9fa
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 799
+Silence is golden
diff --git a/tests/xfs/800 b/tests/xfs/800
new file mode 100755 (executable)
index 0000000..a23e473
--- /dev/null
@@ -0,0 +1,38 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2023 Oracle, Inc.  All Rights Reserved.
+#
+# FS QA Test No. 800
+#
+# Race fsstress doing mostly renames and xfs_scrub in read-only mode for a
+# while to see if we crash or livelock.
+#
+. ./common/preamble
+_begin_fstest scrub dangerous_fsstress_scrub
+
+_cleanup() {
+       cd /
+       _scratch_xfs_stress_scrub_cleanup &> /dev/null
+       rm -r -f $tmp.*
+}
+_register_cleanup "_cleanup" BUS
+
+# Import common functions.
+. ./common/filter
+. ./common/fuzzy
+. ./common/inject
+. ./common/xfs
+
+# real QA test starts here
+_supported_fs xfs
+_require_scratch
+_require_xfs_stress_scrub
+
+_scratch_mkfs > "$seqres.full" 2>&1
+_scratch_mount
+_scratch_xfs_stress_scrub -S '-n' -x 'parent'
+
+# success, all done
+echo Silence is golden
+status=0
+exit
diff --git a/tests/xfs/800.out b/tests/xfs/800.out
new file mode 100644 (file)
index 0000000..bdfaa2c
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 800
+Silence is golden