From: Zorro Lang <zorro.lang@gmail.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Zorro Lang <zlang@redhat.com>,
Naohiro Aota <naohiro.aota@wdc.com>,
fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v4] fstests: test premature ENOSPC in zoned garbage collection
Date: Fri, 17 Apr 2026 02:12:32 +0800 [thread overview]
Message-ID: <aeElJgmNBUflJ_Ut@zlang-mailbox> (raw)
In-Reply-To: <20260415104015.209741-1-johannes.thumshirn@wdc.com>
On Wed, Apr 15, 2026 at 12:40:15PM +0200, Johannes Thumshirn wrote:
> This test stresses garbage collection in zoned file systems by
> constantly overwriting the same file. It is inspired by a reproducer for
> a btrfs bugifx.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> Changes to v3:
> - Distinguish between SCRATCH_DEV and SCRATCH_RTDEV so both BTRFS and
> XFS work
> - Fix typo
>
> Link to v3:
> https://lore.kernel.org/r/20260414143341.167875-1-johannes.thumshirn@wdc.com
>
> tests/generic/999 | 53 +++++++++++++++++++++++++++++++++++++++++++
> tests/generic/999.out | 2 ++
> 2 files changed, 55 insertions(+)
> create mode 100755 tests/generic/999
> create mode 100644 tests/generic/999.out
>
> diff --git a/tests/generic/999 b/tests/generic/999
> new file mode 100755
> index 000000000000..d3b38b676d37
> --- /dev/null
> +++ b/tests/generic/999
> @@ -0,0 +1,53 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2026 Western Digital Corporation. All Rights Reserved.
> +#
> +# FS QA Test 999
> +#
> +# This test stresses garbage collection in zoned file systems by constantly
> +# overwriting the same file. It is inspired by a reproducer for a btrfs bugfix.
> +
> +. ./common/preamble
> +_begin_fstest auto quick zone
> +
> +. ./common/filter
> +
> +
> +if [ -b "$SCRATCH_RTDEV" ]; then
> + zoned_dev=$SCRATCH_RTDEV
> +else
> + zoned_dev=$SCRATCH_DEV
> +fi
I'll move above lines further down, specifically after the _require_scratch_size
call, when I merge this patch. Others make sense to me.
Reviewed-by: Zorro Lang <zlang@kernel.org>
> +
> +_require_scratch_size $((16 * 1024 * 1024))
> +_require_zoned_device "$zoned_dev"
> +_require_command "$BLKZONE_PROG" blkzone
> +
> +# This test requires specific data space usage, skip if we have compression
> +# enabled.
> +_require_no_compress
> +
> +_fixed_by_fs_commit btrfs 7bcb04de982f \
> + "btrfs: zoned: cap delayed refs metadata reservation to avoid overcommit"
> +_fixed_by_fs_commit btrfs 258e46a6385c \
> + "btrfs: zoned: move partially zone_unusable block groups to reclaim list"
> +_fixed_by_fs_commit btrfs e2a7fd22378f \
> + "btrfs: zoned: add zone reclaim flush state for DATA space_info"
> +
> +_scratch_mkfs_sized $((16 * 1024 * 1024 * 1024)) &>>$seqres.full
> +_scratch_mount
> +
> +# Overwrite the data "number of seq zones" times, this is arbitrarily chosen
> +# but triggers the original bug reliably
> +loops=$($BLKZONE_PROG report $zoned_dev | grep -c "SEQ_WRITE_REQUIRED")
> +
> +for (( i = 0; i < $loops; i++ )); do
> + dd if=/dev/zero of=$SCRATCH_MNT/test bs=1M count=1024 status=none
> + if [ $? -ne 0 ]; then
> + _fail "Failed writing on iteration $i"
> + fi
> +done
> +
> +echo "Silence is golden"
> +# success, all done
> +_exit 0
> diff --git a/tests/generic/999.out b/tests/generic/999.out
> new file mode 100644
> index 000000000000..3b276ca804fc
> --- /dev/null
> +++ b/tests/generic/999.out
> @@ -0,0 +1,2 @@
> +QA output created by 999
> +Silence is golden
> --
> 2.53.0
>
>
prev parent reply other threads:[~2026-04-16 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-15 10:40 [PATCH v4] fstests: test premature ENOSPC in zoned garbage collection Johannes Thumshirn
2026-04-16 5:24 ` Christoph Hellwig
2026-04-16 18:12 ` 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=aeElJgmNBUflJ_Ut@zlang-mailbox \
--to=zorro.lang@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--cc=johannes.thumshirn@wdc.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.com \
--cc=zlang@redhat.com \
/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