From: Dave Chinner <david@fromorbit.com>
To: fstests@vger.kernel.org
Subject: [PATCH 1/8] generic/038: kill background threads on interrupt
Date: Tue, 24 May 2022 17:34:04 +1000 [thread overview]
Message-ID: <20220524073411.1943480-2-david@fromorbit.com> (raw)
In-Reply-To: <20220524073411.1943480-1-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
When I ctrl-c g/038, it either does nothing or it leaves processes
running in the background. It is not cleaning up it's background
processes correctly, so add kill vectors into the cleanup. Make sure
we only kill in the cleanup trap if the background processes are
running.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
tests/generic/038 | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/generic/038 b/tests/generic/038
index c6cea94e..0462ea13 100755
--- a/tests/generic/038
+++ b/tests/generic/038
@@ -36,6 +36,10 @@ _begin_fstest auto stress trim
# Override the default cleanup function.
_cleanup()
{
+ [ -n "${create_pids}" ] && kill ${create_pids[@]}
+ [ -n "${fallocate_pids}" ] && kill ${fallocate_pids[@]}
+ [ -n "${trim_pids}" ] && kill ${trim_pids[@]}
+ wait
rm -fr $tmp
}
@@ -47,6 +51,8 @@ _supported_fs generic
_require_scratch
_require_xfs_io_command "falloc"
+echo "Silence is golden"
+
# Keep allocating and deallocating 1G of data space with the goal of creating
# and deleting 1 block group constantly. The intention is to race with the
# fstrim loop below.
@@ -121,6 +127,7 @@ _scratch_mount
_require_fs_space $SCRATCH_MNT $((10 * 1024 * 1024))
_require_batched_discard $SCRATCH_MNT
+
for ((i = 0; i < $((4 * $LOAD_FACTOR)); i++)); do
trim_loop &
trim_pids[$i]=$!
@@ -136,12 +143,9 @@ create_files "foobar"
kill ${fallocate_pids[@]}
kill ${trim_pids[@]}
wait
+unset create_pids
+unset fallocate_pids
+unset trim_pids
-# The fstests framework will now check for fs consistency with fsck.
-# The trimming was racy and caused some btree nodes to get full of zeroes on
-# disk, which obviously caused fs metadata corruption. The race often lead
-# to missing free space entries in a block group's free space cache too.
-
-echo "Silence is golden"
status=0
exit
--
2.35.1
next prev parent reply other threads:[~2022-05-24 7:34 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-24 7:34 [RFC PATCH 0/8] fstests: _cleanup() overrides are a mess Dave Chinner
2022-05-24 7:34 ` Dave Chinner [this message]
2022-05-24 9:41 ` [PATCH 1/8] generic/038: kill background threads on interrupt Amir Goldstein
2022-05-24 12:10 ` Dave Chinner
2022-05-24 12:30 ` Amir Goldstein
2022-05-24 7:34 ` [PATCH 2/8] fstests: _cleanup overrides are messy Dave Chinner
2022-05-24 16:16 ` Amir Goldstein
2022-05-24 7:34 ` [PATCH 3/8] xfs/*: clean up _cleanup override Dave Chinner
2022-05-24 10:42 ` Amir Goldstein
2022-05-24 12:27 ` Dave Chinner
2022-05-24 12:55 ` Amir Goldstein
2022-05-24 13:24 ` Dave Chinner
2022-05-24 14:17 ` Amir Goldstein
2022-05-24 16:32 ` Zorro Lang
2022-05-24 23:34 ` Dave Chinner
2022-05-25 2:54 ` Amir Goldstein
2022-05-24 17:13 ` Zorro Lang
2022-05-26 15:04 ` Zorro Lang
2022-05-26 23:39 ` Dave Chinner
2022-05-24 7:34 ` [PATCH 4/8] fstests: define a common _dump_cleanup function Dave Chinner
2022-05-24 9:04 ` Amir Goldstein
2022-05-24 9:52 ` Dave Chinner
2022-05-24 9:59 ` Amir Goldstein
2022-05-24 7:34 ` [PATCH 5/8] fstests: use a common fsstress cleanup function Dave Chinner
2022-05-24 12:25 ` Amir Goldstein
2022-05-24 7:34 ` [PATCH 6/8] fstests: consolidate no cleanup test setup Dave Chinner
2022-05-24 12:22 ` Amir Goldstein
2022-05-24 13:07 ` Dave Chinner
2022-05-24 7:34 ` [PATCH 7/8] fstests: Set up BUS trap for tests by default Dave Chinner
2022-05-24 8:48 ` Amir Goldstein
2022-05-24 7:34 ` [PATCH 8/8] fstests: cleanup _cleanup usage in shared Dave Chinner
2022-05-24 10:49 ` Amir Goldstein
2022-05-24 11:11 ` Amir Goldstein
2022-05-24 8:29 ` [RFC PATCH 0/8] fstests: _cleanup() overrides are a mess Amir Goldstein
2022-05-24 9:57 ` Dave Chinner
2022-05-24 10:01 ` Amir Goldstein
2022-05-24 10:13 ` Dave Chinner
2022-05-24 12:14 ` Amir Goldstein
2022-05-24 12:28 ` Dave Chinner
2022-05-24 12:34 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220524073411.1943480-2-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox