Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: fdmanana@kernel.org, fstests@vger.kernel.org
Cc: 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: Fri, 18 Sep 2026 07:15:45 +0930	[thread overview]
Message-ID: <772772ae-216b-411d-893c-ca06c3969a5b@gmx.com> (raw)
In-Reply-To: <a6bc4f66b0217153cb55ea987c26de70c50eba48.1789660025.git.fdmanana@suse.com>



在 2026/9/18 01:22, fdmanana@kernel.org 写道:
> 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>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   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


  reply	other threads:[~2026-09-17 21:45 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 [this message]
2026-09-20 11:49 ` Zorro Lang

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=772772ae-216b-411d-893c-ca06c3969a5b@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --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