From: Darrick J. Wong Date: Fri, 30 Dec 2022 22:13:00 +0000 (-0800) Subject: xfs: stress test xfs_scrub(8) with freeze and ro-remount loops X-Git-Tag: v2023.01.15^0 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e64416195116eb99011d8db1b1c66db234eddb9c;p=xfstests-dev.git xfs: stress test xfs_scrub(8) with freeze and ro-remount loops Make sure we don't trip over any asserts or livelock when scrub races with filesystem freezing and readonly remounts. Signed-off-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/561 b/tests/xfs/561 new file mode 100755 index 00000000..c1d68c6f --- /dev/null +++ b/tests/xfs/561 @@ -0,0 +1,39 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test No. 561 +# +# Race xfs_scrub in check-only mode and ro remount for a while to see if we +# crash or livelock. +# +. ./common/preamble +_begin_fstest scrub dangerous_fsstress_scrub + +# Override the default cleanup function. +_cleanup() +{ + cd / + _scratch_xfs_stress_scrub_cleanup &> /dev/null + _scratch_remount rw + rm -rf $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./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 -r 5 -S '-n' + +# success, all done +echo "Silence is golden" +status=0 +exit diff --git a/tests/xfs/561.out b/tests/xfs/561.out new file mode 100644 index 00000000..5e46f61f --- /dev/null +++ b/tests/xfs/561.out @@ -0,0 +1,2 @@ +QA output created by 561 +Silence is golden diff --git a/tests/xfs/562 b/tests/xfs/562 new file mode 100755 index 00000000..a5c6e888 --- /dev/null +++ b/tests/xfs/562 @@ -0,0 +1,39 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test No. 562 +# +# Race xfs_scrub in check-only mode and freeze for a while to see if we crash +# or livelock. +# +. ./common/preamble +_begin_fstest scrub dangerous_fsstress_scrub + +# Override the default cleanup function. +_cleanup() +{ + cd / + _scratch_xfs_stress_scrub_cleanup &> /dev/null + _scratch_remount rw + rm -rf $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./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 -f -S '-n' + +# success, all done +echo "Silence is golden" +status=0 +exit diff --git a/tests/xfs/562.out b/tests/xfs/562.out new file mode 100644 index 00000000..6203d9a3 --- /dev/null +++ b/tests/xfs/562.out @@ -0,0 +1,2 @@ +QA output created by 562 +Silence is golden diff --git a/tests/xfs/563 b/tests/xfs/563 new file mode 100755 index 00000000..409a42be --- /dev/null +++ b/tests/xfs/563 @@ -0,0 +1,40 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test No. 563 +# +# Race xfs_scrub in force-repair mdoe and freeze for a while to see if we crash +# or livelock. +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +# Override the default cleanup function. +_cleanup() +{ + cd / + _scratch_xfs_stress_scrub_cleanup &> /dev/null + _scratch_remount rw + rm -rf $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/xfs +. ./common/inject + +# 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 -f -S '-k' + +# success, all done +echo "Silence is golden" +status=0 +exit diff --git a/tests/xfs/563.out b/tests/xfs/563.out new file mode 100644 index 00000000..76aea88b --- /dev/null +++ b/tests/xfs/563.out @@ -0,0 +1,2 @@ +QA output created by 563 +Silence is golden diff --git a/tests/xfs/564 b/tests/xfs/564 new file mode 100755 index 00000000..11b3fecb --- /dev/null +++ b/tests/xfs/564 @@ -0,0 +1,40 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2022 Oracle. All Rights Reserved. +# +# FS QA Test No. 564 +# +# Race xfs_scrub in force-repair mode and ro remount for a while to see if we +# crash or livelock. +# +. ./common/preamble +_begin_fstest online_repair dangerous_fsstress_repair + +# Override the default cleanup function. +_cleanup() +{ + cd / + _scratch_xfs_stress_scrub_cleanup &> /dev/null + _scratch_remount rw + rm -rf $tmp.* +} + +# Import common functions. +. ./common/filter +. ./common/fuzzy +. ./common/xfs +. ./common/inject + +# 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 -r 5 -S '-k' + +# success, all done +echo "Silence is golden" +status=0 +exit diff --git a/tests/xfs/564.out b/tests/xfs/564.out new file mode 100644 index 00000000..4012acac --- /dev/null +++ b/tests/xfs/564.out @@ -0,0 +1,2 @@ +QA output created by 564 +Silence is golden