From: Zorro Lang <zlang@kernel.org>
To: fdmanana@kernel.org
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] btrfs/255: add _cleanup function to kill the balance stress process
Date: Sun, 20 Sep 2026 19:49:21 +0800 [thread overview]
Message-ID: <aq_IJyTS8q4ByIqv@zlang-mailbox> (raw)
In-Reply-To: <a6bc4f66b0217153cb55ea987c26de70c50eba48.1789660025.git.fdmanana@suse.com>
On Thu, Sep 17, 2026 at 04:52:56PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> Currently if we interrupt the test and balance stress process is already
> running, it keeps running after the test is interrupted, requiring the
> user to manually kill the balance stress process before it can run any
> fstest that uses the scratch device. So add a _cleanup function that
> ensures the balance stress process is killed when the test is interrupted.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
Makes sense to me, thanks!
Reviewed-by: Zorro Lang <zlang@kernel.org>
> tests/btrfs/255 | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/tests/btrfs/255 b/tests/btrfs/255
> index 14c12904..fbcbf57c 100755
> --- a/tests/btrfs/255
> +++ b/tests/btrfs/255
> @@ -12,6 +12,15 @@
> . ./common/preamble
> _begin_fstest auto qgroup balance
>
> +_cleanup()
> +{
> + cd /
> + rm -rf $tmp.*
> + if [ -n "$balance_pid" ]; then
> + _btrfs_kill_stress_balance_pid $balance_pid
> + fi
> +}
> +
> _require_scratch
>
> _scratch_mkfs >> $seqres.full 2>&1
> @@ -40,8 +49,6 @@ for ((i = 0; i < 20; i++)); do
> $BTRFS_UTIL_PROG quota disable $SCRATCH_MNT
> done
>
> -_btrfs_kill_stress_balance_pid $balance_pid
> -
> echo "Silence is golden"
> status=0
> exit
> --
> 2.47.2
>
>
prev parent reply other threads:[~2026-09-20 11:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 15:52 [PATCH] btrfs/255: add _cleanup function to kill the balance stress process fdmanana
2026-09-17 21:45 ` Qu Wenruo
2026-09-20 11:49 ` Zorro Lang [this message]
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=aq_IJyTS8q4ByIqv@zlang-mailbox \
--to=zlang@kernel.org \
--cc=fdmanana@kernel.org \
--cc=fdmanana@suse.com \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@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