* [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid
2026-07-20 11:18 [PATCH 0/5] fstests: misc fixes for zoned btrfs Johannes Thumshirn
@ 2026-07-20 11:18 ` Johannes Thumshirn
2026-07-20 16:44 ` Filipe Manana
2026-07-20 11:18 ` [PATCH 2/5] btrfs/199: skip on zoned devices Johannes Thumshirn
` (3 subsequent siblings)
4 siblings, 1 reply; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-20 11:18 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Johannes Thumshirn
_check_temp_fsid() extracted the on-disk fsid with "awk -d\" \"",
but -d is gawk's --dump-variables option, not a field separator.
As a result awk tried to open a file named " " for writing and dumped
its variable list, polluting the test output with messages like:
awk: warning: could not open ' ' for writing: Read-only file system
awk: warning: sending variable list to standard error
ARGC: 1
ARGIND: 0
...
which made btrfs/311 (the only test currently exercising this helper)
fail. Use -F" " to set the field separator as intended.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
common/btrfs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/btrfs b/common/btrfs
index 30288f07b61a..d477bd9e38ea 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -980,7 +980,7 @@ _check_temp_fsid()
# on disk fsid
fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \
- grep ^fsid | $AWK_PROG -d" " '{print $2}')
+ grep ^fsid | $AWK_PROG -F" " '{print $2}')
echo -e "On disk fsid:\t\t$fsid" | sed -e "s/$fsid/FSID/g"
# Print FSID even if it is not the same as metadata_uuid because it has
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid
2026-07-20 11:18 ` [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid Johannes Thumshirn
@ 2026-07-20 16:44 ` Filipe Manana
2026-07-21 6:43 ` Johannes Thumshirn
0 siblings, 1 reply; 10+ messages in thread
From: Filipe Manana @ 2026-07-20 16:44 UTC (permalink / raw)
To: Johannes Thumshirn; +Cc: Zorro Lang, fstests, linux-btrfs
On Mon, Jul 20, 2026 at 12:34 PM Johannes Thumshirn
<johannes.thumshirn@wdc.com> wrote:
>
> _check_temp_fsid() extracted the on-disk fsid with "awk -d\" \"",
> but -d is gawk's --dump-variables option, not a field separator.
> As a result awk tried to open a file named " " for writing and dumped
> its variable list, polluting the test output with messages like:
>
> awk: warning: could not open ' ' for writing: Read-only file system
> awk: warning: sending variable list to standard error
> ARGC: 1
> ARGIND: 0
> ...
>
> which made btrfs/311 (the only test currently exercising this helper)
> fail. Use -F" " to set the field separator as intended.
This is all correct and makes sense.
I wonder why the test doesn't fail on my Debian box.
My awk is a symlink to gawk and the man page, as well as running 'awk
--help', confirms -d is to dump variables to a file and -F is the
field separator as you say here.
So I'm puzzled. Any idea?
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> common/btrfs | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/btrfs b/common/btrfs
> index 30288f07b61a..d477bd9e38ea 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -980,7 +980,7 @@ _check_temp_fsid()
>
> # on disk fsid
> fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \
> - grep ^fsid | $AWK_PROG -d" " '{print $2}')
> + grep ^fsid | $AWK_PROG -F" " '{print $2}')
> echo -e "On disk fsid:\t\t$fsid" | sed -e "s/$fsid/FSID/g"
>
> # Print FSID even if it is not the same as metadata_uuid because it has
> --
> 2.54.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid
2026-07-20 16:44 ` Filipe Manana
@ 2026-07-21 6:43 ` Johannes Thumshirn
0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-21 6:43 UTC (permalink / raw)
To: Filipe Manana; +Cc: Zorro Lang, fstests, linux-btrfs
On 20.07.26 18:44, Filipe Manana wrote:
> On Mon, Jul 20, 2026 at 12:34 PM Johannes Thumshirn
> <johannes.thumshirn@wdc.com> wrote:
>>
>> _check_temp_fsid() extracted the on-disk fsid with "awk -d\" \"",
>> but -d is gawk's --dump-variables option, not a field separator.
>> As a result awk tried to open a file named " " for writing and dumped
>> its variable list, polluting the test output with messages like:
>>
>> awk: warning: could not open ' ' for writing: Read-only file system
>> awk: warning: sending variable list to standard error
>> ARGC: 1
>> ARGIND: 0
>> ...
>>
>> which made btrfs/311 (the only test currently exercising this helper)
>> fail. Use -F" " to set the field separator as intended.
>
> This is all correct and makes sense.
>
> I wonder why the test doesn't fail on my Debian box.
> My awk is a symlink to gawk and the man page, as well as running 'awk
> --help', confirms -d is to dump variables to a file and -F is the
> field separator as you say here.
>
> So I'm puzzled. Any idea?
I have no idea. Fails reliably on all my Fedora boxes.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 2/5] btrfs/199: skip on zoned devices
2026-07-20 11:18 [PATCH 0/5] fstests: misc fixes for zoned btrfs Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid Johannes Thumshirn
@ 2026-07-20 11:18 ` Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 3/5] generic/746: skip on zoned btrfs Johannes Thumshirn
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-20 11:18 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Johannes Thumshirn
The test detects trimmed bytes via the used space of the loopback
backing file, which requires the backing filesystem to support hole
punching triggered by loop device discards. Zoned btrfs does not
support fallocate/punch hole, so discards to the loop device are
rejected ("operation not supported") and the test cannot measure
anything meaningful.
Skip the test when the scratch device is zoned.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
tests/btrfs/199 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/btrfs/199 b/tests/btrfs/199
index f161e55057ff..ec9f37830c2d 100755
--- a/tests/btrfs/199
+++ b/tests/btrfs/199
@@ -31,6 +31,7 @@ _fixed_by_kernel_commit 6b7faadd985c \
_require_loop
_require_xfs_io_command "fiemap"
+_require_non_zoned_device $SCRATCH_DEV
# We need less than 2G data write, consider it 2G and double it just in case
_require_scratch_size $((4 * 1024 * 1024))
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 3/5] generic/746: skip on zoned btrfs
2026-07-20 11:18 [PATCH 0/5] fstests: misc fixes for zoned btrfs Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 1/5] common/btrfs: fix awk field separator in _check_temp_fsid Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 2/5] btrfs/199: skip on zoned devices Johannes Thumshirn
@ 2026-07-20 11:18 ` Johannes Thumshirn
2026-07-20 17:37 ` Christoph Hellwig
2026-07-20 11:18 ` [PATCH 4/5] btrfs/284: skip on zoned devices Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 5/5] generic/781: fix copyright Johannes Thumshirn
4 siblings, 1 reply; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-20 11:18 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Johannes Thumshirn
The test relies on loop device discards punching holes in the backing
image file (holes are then detected via fiemap on the backing file).
Zoned btrfs does not support fallocate/punch hole, so fstrim on the
loop device cannot free space in the backing file and the test cannot
work.
Skip the test on zoned devices, but only for btrfs so that other
filesystems (e.g. zoned XFS/f2fs) can still run it.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
tests/generic/746 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/generic/746 b/tests/generic/746
index 4eb4252b8ba0..db4e40d5cec7 100755
--- a/tests/generic/746
+++ b/tests/generic/746
@@ -11,6 +11,7 @@ _begin_fstest auto trim fiemap
_require_test
_require_loop
+[[ $FSTYP == "btrfs" ]] && _require_non_zoned_device $TEST_DEV
_require_fstrim
_require_xfs_io_command "fiemap"
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/5] generic/746: skip on zoned btrfs
2026-07-20 11:18 ` [PATCH 3/5] generic/746: skip on zoned btrfs Johannes Thumshirn
@ 2026-07-20 17:37 ` Christoph Hellwig
2026-07-27 9:00 ` Johannes Thumshirn
0 siblings, 1 reply; 10+ messages in thread
From: Christoph Hellwig @ 2026-07-20 17:37 UTC (permalink / raw)
To: Johannes Thumshirn; +Cc: Zorro Lang, fstests, linux-btrfs
On Mon, Jul 20, 2026 at 01:18:47PM +0200, Johannes Thumshirn wrote:
> The test relies on loop device discards punching holes in the backing
> image file (holes are then detected via fiemap on the backing file).
> Zoned btrfs does not support fallocate/punch hole, so fstrim on the
> loop device cannot free space in the backing file and the test cannot
> work.
>
> Skip the test on zoned devices, but only for btrfs so that other
> filesystems (e.g. zoned XFS/f2fs) can still run it.
This should use feature detection and not hard code file systems.
I'm also a bit surprised that zoned btrfs doesn't support hole
punches. Unlike classic unwritten extents there is nothing in a
zone model preventing them from working. Did you try just enabling
hole punches in btrfs?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/5] generic/746: skip on zoned btrfs
2026-07-20 17:37 ` Christoph Hellwig
@ 2026-07-27 9:00 ` Johannes Thumshirn
0 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-27 9:00 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Zorro Lang, fstests, linux-btrfs
On Mon, Jul 20, 2026 at 10:37:38AM -0700, Christoph Hellwig wrote:
> On Mon, Jul 20, 2026 at 01:18:47PM +0200, Johannes Thumshirn wrote:
> > The test relies on loop device discards punching holes in the backing
> > image file (holes are then detected via fiemap on the backing file).
> > Zoned btrfs does not support fallocate/punch hole, so fstrim on the
> > loop device cannot free space in the backing file and the test cannot
> > work.
> >
> > Skip the test on zoned devices, but only for btrfs so that other
> > filesystems (e.g. zoned XFS/f2fs) can still run it.
>
> This should use feature detection and not hard code file systems.
I didn't find anything for that. Only using _require_xfs_io_command
"fpunch", but the test is not using ot so it felt wrong.
>
> I'm also a bit surprised that zoned btrfs doesn't support hole
> punches. Unlike classic unwritten extents there is nothing in a
> zone model preventing them from working. Did you try just enabling
> hole punches in btrfs?
>
It is not the zoned device model that prevents us but a desciccion we
did in zoned BTRFS when doing the initial support for it. I can look
into hole punching but I got a lot of other more urgent fires to put out
and features people are waiting for first.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 4/5] btrfs/284: skip on zoned devices
2026-07-20 11:18 [PATCH 0/5] fstests: misc fixes for zoned btrfs Johannes Thumshirn
` (2 preceding siblings ...)
2026-07-20 11:18 ` [PATCH 3/5] generic/746: skip on zoned btrfs Johannes Thumshirn
@ 2026-07-20 11:18 ` Johannes Thumshirn
2026-07-20 11:18 ` [PATCH 5/5] generic/781: fix copyright Johannes Thumshirn
4 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-20 11:18 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Johannes Thumshirn
Incremental send stream v2 uses fallocate(PUNCH_HOLE) to represent
holes, which btrfs receive replays. Zoned btrfs rejects all fallocate
modes, so receiving a stream with holes fails. Skip on zoned devices.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
tests/btrfs/284 | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/btrfs/284 b/tests/btrfs/284
index ec3bc2720935..fc34df88baa7 100755
--- a/tests/btrfs/284
+++ b/tests/btrfs/284
@@ -17,6 +17,7 @@ _require_test
# least $LOAD_FACTOR * 1G, just to be on the safe side.
_require_scratch_size $(($LOAD_FACTOR * 1 * 1024 * 1024))
_require_fssum
+_require_non_zoned_device $SCRATCH_DEV
_fixed_by_git_commit btrfs-progs e3209f8792f4 \
"btrfs-progs: receive: fix a corruption when decompressing zstd extents"
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH 5/5] generic/781: fix copyright
2026-07-20 11:18 [PATCH 0/5] fstests: misc fixes for zoned btrfs Johannes Thumshirn
` (3 preceding siblings ...)
2026-07-20 11:18 ` [PATCH 4/5] btrfs/284: skip on zoned devices Johannes Thumshirn
@ 2026-07-20 11:18 ` Johannes Thumshirn
4 siblings, 0 replies; 10+ messages in thread
From: Johannes Thumshirn @ 2026-07-20 11:18 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests, linux-btrfs, Johannes Thumshirn, Christoph Hellwig
My employer is called Western Digital not Wesgtern Digital. I'm sorry.
Spotted-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
tests/generic/781 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/generic/781 b/tests/generic/781
index 575cc4abfb7b..38536d64e3cd 100755
--- a/tests/generic/781
+++ b/tests/generic/781
@@ -1,6 +1,6 @@
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2025 Wesgtern Digital Corporation. All Rights Reserved.
+# Copyright (c) 2025 Western Digital Corporation. All Rights Reserved.
#
# FS QA Test No. 781
#
--
2.54.0
^ permalink raw reply related [flat|nested] 10+ messages in thread