public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fstests: test premature ENOSPC in zoned garbage collection
@ 2026-02-10 11:11 Johannes Thumshirn
  2026-02-10 15:51 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Johannes Thumshirn @ 2026-02-10 11:11 UTC (permalink / raw)
  To: Zorro Lang
  Cc: Christoph Hellwig, linux-btrfs, fstests, Hans Holmberg,
	Naohiro Aota, Johannes Thumshirn

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-03-09 16:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 11:11 [PATCH] fstests: test premature ENOSPC in zoned garbage collection Johannes Thumshirn
2026-02-10 15:51 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox