From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: Zorro Lang <zlang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
linux-btrfs@vger.kernel.org, fstests@vger.kernel.org,
Hans Holmberg <Hans.Holmberg@wdc.com>,
Naohiro Aota <naohiro.aota@wdc.com>,
Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH] fstests: test premature ENOSPC in zoned garbage collection
Date: Tue, 10 Feb 2026 12:11:03 +0100 [thread overview]
Message-ID: <20260210111103.265664-1-johannes.thumshirn@wdc.com> (raw)
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>
---
tests/generic/783 | 48 +++++++++++++++++++++++++++++++++++++++++++
tests/generic/783.out | 2 ++
2 files changed, 50 insertions(+)
create mode 100755 tests/generic/783
create mode 100644 tests/generic/783.out
diff --git a/tests/generic/783 b/tests/generic/783
new file mode 100755
index 000000000000..f996d78803a1
--- /dev/null
+++ b/tests/generic/783
@@ -0,0 +1,48 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2026 Western Digital Corporation. All Rights Reserved.
+#
+# FS QA Test 783
+#
+# 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.
+
+. ./common/preamble
+_begin_fstest auto quick zone
+
+. ./common/filter
+
+_require_scratch_size $((16 * 1024 * 1024))
+_require_zoned_device "$SCRATCH_DEV"
+
+# This test requires specific data space usage, skip if we have compression
+# enabled.
+_require_no_compress
+
+if [ "$FSTYP" = btrfs ]; then
+ _fixed_by_kernel_commit XXXXXXXXXXXX \
+ "btrfs: zoned: cap delayed refs metadata reservation to avoid overcommit"
+ _fixed_by_kernel_commit XXXXXXXXXXXX \
+ "btrfs: zoned: move partially zone_unusable block groups to reclaim list"
+ _fixed_by_kernel_commit XXXXXXXXXXXX \
+ "btrfs: zoned: add zone reclaim flush state for DATA space_info"
+fi
+
+_scratch_mkfs_sized $((16 * 1024 * 1024 * 1024)) &>>$seqres.full
+_scratch_mount
+
+blocks="$(df -TB 1G $SCRATCH_DEV |\
+ $AWK_PROG -v fstyp="$FSTYP" 'match($2, fstyp) {print $3}')"
+
+loops=$(echo "$blocks * 4 - 2" | bc)
+
+for (( i = 0; i < $loops; i++)); do
+ dd if=/dev/zero of=$SCRATCH_MNT/test bs=1M count=1024 status=none 2>&1
+ 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/783.out b/tests/generic/783.out
new file mode 100644
index 000000000000..2522395956d4
--- /dev/null
+++ b/tests/generic/783.out
@@ -0,0 +1,2 @@
+QA output created by 783
+Silence is golden
--
2.53.0
next reply other threads:[~2026-02-10 11:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 11:11 Johannes Thumshirn [this message]
2026-02-10 15:51 ` [PATCH] fstests: test premature ENOSPC in zoned garbage collection Christoph Hellwig
2026-02-10 15:58 ` Johannes Thumshirn
2026-02-11 15:29 ` Zorro Lang
2026-03-05 8:50 ` Johannes Thumshirn
2026-03-09 15:31 ` Zorro Lang
2026-03-09 15:35 ` Johannes Thumshirn
2026-03-09 16:51 ` 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=20260210111103.265664-1-johannes.thumshirn@wdc.com \
--to=johannes.thumshirn@wdc.com \
--cc=Hans.Holmberg@wdc.com \
--cc=fstests@vger.kernel.org \
--cc=hch@lst.de \
--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