public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] fstests: basic smoke test on zoned loop device
@ 2025-10-13  8:07 Johannes Thumshirn
  2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Johannes Thumshirn @ 2025-10-13  8:07 UTC (permalink / raw)
  To: Zorro Lang
  Cc: Christoph Hellwig, Naohiro Aota, linux-btrfs, Hans Holmberg,
	fstests, linux-xfs, Carlos Maiolino, Darrick J . Wong,
	Johannes Thumshirn

Add a very basic smoke test on a zoned loopback device to check that noone is
accidentially breaking support for zoned block devices in filesystems that
support these.

Currently this includes btrfs, f2fs and xfs.


Changes to v2:
- Add Carlos' Reviewed-bys
- Add a _find_last_zloop() helper

Johannes Thumshirn (3):
  common/zoned: add _require_zloop
  common/zoned: add _create_zloop
  generic: basic smoke for filesystems on zoned block devices

 common/zoned          | 37 ++++++++++++++++++++++++++++++++
 tests/generic/772     | 49 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/772.out |  2 ++
 3 files changed, 88 insertions(+)
 create mode 100755 tests/generic/772
 create mode 100644 tests/generic/772.out

-- 
2.51.0


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

* [PATCH v3 1/3] common/zoned: add _require_zloop
  2025-10-13  8:07 [PATCH v3 0/3] fstests: basic smoke test on zoned loop device Johannes Thumshirn
@ 2025-10-13  8:07 ` Johannes Thumshirn
  2025-10-13  8:43   ` Naohiro Aota
  2025-10-14  4:33   ` Christoph Hellwig
  2025-10-13  8:07 ` [PATCH v3 2/3] common/zoned: add _create_zloop Johannes Thumshirn
  2025-10-13  8:07 ` [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices Johannes Thumshirn
  2 siblings, 2 replies; 14+ messages in thread
From: Johannes Thumshirn @ 2025-10-13  8:07 UTC (permalink / raw)
  To: Zorro Lang
  Cc: Christoph Hellwig, Naohiro Aota, linux-btrfs, Hans Holmberg,
	fstests, linux-xfs, Carlos Maiolino, Darrick J . Wong,
	Johannes Thumshirn, Carlos Maiolino

Add _require_zloop() function used by tests that require support for the
zoned loopback block device.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 common/zoned | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/common/zoned b/common/zoned
index eed0082a..41697b08 100644
--- a/common/zoned
+++ b/common/zoned
@@ -37,3 +37,11 @@ _zone_capacity() {
 	       grep -Po "cap 0x[[:xdigit:]]+" | cut -d ' ' -f 2)
     echo $((size << 9))
 }
+
+_require_zloop()
+{
+    modprobe zloop >/dev/null 2>&1
+    if [ ! -c "/dev/zloop-control" ]; then
+	    _notrun "This test requires zoned loopback device support"
+    fi
+}
-- 
2.51.0


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

* [PATCH v3 2/3] common/zoned: add _create_zloop
  2025-10-13  8:07 [PATCH v3 0/3] fstests: basic smoke test on zoned loop device Johannes Thumshirn
  2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
@ 2025-10-13  8:07 ` Johannes Thumshirn
  2025-10-14  9:04   ` Naohiro Aota
  2025-10-13  8:07 ` [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices Johannes Thumshirn
  2 siblings, 1 reply; 14+ messages in thread
From: Johannes Thumshirn @ 2025-10-13  8:07 UTC (permalink / raw)
  To: Zorro Lang
  Cc: Christoph Hellwig, Naohiro Aota, linux-btrfs, Hans Holmberg,
	fstests, linux-xfs, Carlos Maiolino, Darrick J . Wong,
	Johannes Thumshirn

Add _create_zloop a helper function for creating a zloop device.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 common/zoned | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/common/zoned b/common/zoned
index 41697b08..59bebcae 100644
--- a/common/zoned
+++ b/common/zoned
@@ -45,3 +45,32 @@ _require_zloop()
 	    _notrun "This test requires zoned loopback device support"
     fi
 }
+
+_find_next_zloop()
+{
+    local last_id=$(ls /dev/zloop* 2> /dev/null | grep -E "zloop[0-9]+" | wc -l)
+    echo $last_id
+}
+
+# Create a zloop device
+# useage: _create_zloop [id] <base_dir> <zone_size> <nr_conv_zones>
+_create_zloop()
+{
+    local id=$1
+
+    if [ -n "$2" ]; then
+        local base_dir=",base_dir=$2"
+    fi
+
+    if [ -n "$3" ]; then
+        local zone_size=",zone_size_mb=$3"
+    fi
+
+    if [ -n "$4" ]; then
+        local conv_zones=",conv_zones=$4"
+    fi
+
+    local zloop_args="add id=$id$base_dir$zone_size$conv_zones"
+
+    echo "$zloop_args" > /dev/zloop-control
+}
-- 
2.51.0


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

* [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13  8:07 [PATCH v3 0/3] fstests: basic smoke test on zoned loop device Johannes Thumshirn
  2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
  2025-10-13  8:07 ` [PATCH v3 2/3] common/zoned: add _create_zloop Johannes Thumshirn
@ 2025-10-13  8:07 ` Johannes Thumshirn
  2025-10-13 13:55   ` Anand Jain
  2025-10-14  4:33   ` Christoph Hellwig
  2 siblings, 2 replies; 14+ messages in thread
From: Johannes Thumshirn @ 2025-10-13  8:07 UTC (permalink / raw)
  To: Zorro Lang
  Cc: Christoph Hellwig, Naohiro Aota, linux-btrfs, Hans Holmberg,
	fstests, linux-xfs, Carlos Maiolino, Darrick J . Wong,
	Johannes Thumshirn, Carlos Maiolino

Add a basic smoke test for filesystems that support running on zoned
block devices.

It creates a zloop device with 2 conventional and 62 sequential zones,
mounts it and then runs fsx on it.

Currently this tests supports BTRFS, F2FS and XFS.

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 tests/generic/772     | 49 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/772.out |  2 ++
 2 files changed, 51 insertions(+)
 create mode 100755 tests/generic/772
 create mode 100644 tests/generic/772.out

diff --git a/tests/generic/772 b/tests/generic/772
new file mode 100755
index 00000000..d9b84614
--- /dev/null
+++ b/tests/generic/772
@@ -0,0 +1,49 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Wesgtern Digital Corporation.  All Rights Reserved.
+#
+# FS QA Test 772
+#
+# Smoke test for FSes with ZBD support on zloop
+#
+. ./common/preamble
+_begin_fstest auto zone quick
+
+_cleanup()
+{
+	if test -b /dev/zloop$ID; then
+		echo "remove id=$ID" > /dev/zloop-control
+	fi
+}
+
+. ./common/zoned
+
+# Modify as appropriate.
+_require_scratch
+_require_scratch_size $((16 * 1024 * 1024)) #kB
+_require_zloop
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+ID=$(_find_next_zloop)
+
+mnt="$SCRATCH_MNT/mnt"
+zloopdir="$SCRATCH_MNT/zloop"
+
+mkdir -p "$zloopdir/$ID"
+mkdir -p $mnt
+_create_zloop $ID $zloopdir 256 2
+zloop="/dev/zloop$ID"
+
+_try_mkfs_dev $zloop 2>&1 >> $seqres.full ||\
+	_notrun "cannot mkfs zoned filesystem"
+_mount $zloop $mnt
+
+$FSX_PROG -q -N 20000 $FSX_AVOID "$mnt/fsx" >> $seqres.full
+
+umount $mnt
+
+echo Silence is golden
+# success, all done
+_exit 0
diff --git a/tests/generic/772.out b/tests/generic/772.out
new file mode 100644
index 00000000..98c13968
--- /dev/null
+++ b/tests/generic/772.out
@@ -0,0 +1,2 @@
+QA output created by 772
+Silence is golden
-- 
2.51.0


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

* Re: [PATCH v3 1/3] common/zoned: add _require_zloop
  2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
@ 2025-10-13  8:43   ` Naohiro Aota
  2025-10-14  4:33   ` Christoph Hellwig
  1 sibling, 0 replies; 14+ messages in thread
From: Naohiro Aota @ 2025-10-13  8:43 UTC (permalink / raw)
  To: Johannes Thumshirn, Zorro Lang
  Cc: hch, Naohiro Aota, linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino

On Mon Oct 13, 2025 at 5:07 PM JST, Johannes Thumshirn wrote:
> Add _require_zloop() function used by tests that require support for the
> zoned loopback block device.
>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>

> ---
>  common/zoned | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/common/zoned b/common/zoned
> index eed0082a..41697b08 100644
> --- a/common/zoned
> +++ b/common/zoned
> @@ -37,3 +37,11 @@ _zone_capacity() {
>  	       grep -Po "cap 0x[[:xdigit:]]+" | cut -d ' ' -f 2)
>      echo $((size << 9))
>  }
> +
> +_require_zloop()
> +{
> +    modprobe zloop >/dev/null 2>&1
> +    if [ ! -c "/dev/zloop-control" ]; then
> +	    _notrun "This test requires zoned loopback device support"
> +    fi
> +}

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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13  8:07 ` [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices Johannes Thumshirn
@ 2025-10-13 13:55   ` Anand Jain
  2025-10-13 14:06     ` Johannes Thumshirn
  2025-10-14  4:33   ` Christoph Hellwig
  1 sibling, 1 reply; 14+ messages in thread
From: Anand Jain @ 2025-10-13 13:55 UTC (permalink / raw)
  To: Johannes Thumshirn, Zorro Lang
  Cc: Christoph Hellwig, Naohiro Aota, linux-btrfs, Hans Holmberg,
	fstests, linux-xfs, Carlos Maiolino, Darrick J . Wong,
	Carlos Maiolino


Johannes,

The test case is failing with XFS. For some reason, the mkfs error 
wasn't captured in the output, so I had to modify the test slightly. 
Errors and the diff is below.

Thanks, Anand

-------
SECTION       -- generic-config
RECREATING    -- xfs on /dev/sde
FSTYP         -- xfs (non-debug)
PLATFORM      -- Linux/x86_64 feddev 6.16.10-100.fc41.x86_64 #1 SMP 
PREEMPT_DYNAMIC Thu Oct  2 18:19:14 UTC 2025
MKFS_OPTIONS  -- -f /dev/sda
MOUNT_OPTIONS -- /dev/sda /mnt/scratch

generic/772       [not run] cannot mkfs zoned filesystem
Ran: generic/772
Not run: generic/772
Passed all 1 tests

SECTION       -- generic-config
=========================
Ran: generic/772
Not run: generic/772
Passed all 1 tests
--------------

$ dmesg

[ 2089.280926] XFS (sda): Ending clean mount
[ 2089.786335] zloop: Added device 0: 64 zones of 256 MB, 4096 B block size
[ 2089.848065] zloop: Zone 63: unaligned write: sect 33554176, wp 33030144
[ 2089.848081] zloop: Zone 63: failed write sector 33554176, 256 sectors
[ 2089.848086] I/O error, dev zloop0, sector 33554176 op 0x1:(WRITE) 
flags 0x8800 phys_seg 32 prio class 2
[ 2089.862921] zloop: Zone 32: unaligned write: sect 16777296, wp 16777216
[ 2089.862934] zloop: Zone 32: failed write sector 16777296, 1024 sectors
[ 2089.862939] I/O error, dev zloop0, sector 16777296 op 0x1:(WRITE) 
flags 0x4000 phys_seg 128 prio class 2

-----------------

$ cat ./results/generic-config/generic/772.full

echo '1' 2>&1 > /sys/fs/xfs/sda/error/fail_at_unmount
echo '0' 2>&1 > /sys/fs/xfs/sda/error/metadata/EIO/max_retries
echo '0' 2>&1 > /sys/fs/xfs/sda/error/metadata/EIO/retry_timeout_seconds
mkfs.xfs: pwrite failed: Input/output error
libxfs_bwrite: write failed on (unknown) bno 0x1ffff00/0x100, err=5
mkfs.xfs: Releasing dirty buffer to free list!
found dirty buffer (bulk) on free list!
mkfs.xfs: libxfs_device_zero write failed: Input/output error
meta-data=/dev/zloop0            isize=512    agcount=4, agsize=1048576 blks
          =                       sectsz=4096  attr=2, projid32bit=1
          =                       crc=1        finobt=1, sparse=1, rmapbt=1
          =                       reflink=1    bigtime=1 inobtcount=1 
nrext64=1
data     =                       bsize=4096   blocks=4194304, imaxpct=25
          =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
          =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0



$ git diff
diff --git a/tests/generic/772 b/tests/generic/772
index d9b84614da3d..54da97fdd00f 100755
--- a/tests/generic/772
+++ b/tests/generic/772
@@ -36,8 +36,9 @@ mkdir -p $mnt
  _create_zloop $ID $zloopdir 256 2
  zloop="/dev/zloop$ID"

-_try_mkfs_dev $zloop 2>&1 >> $seqres.full ||\
+if ! _try_mkfs_dev $zloop >> $seqres.full 2>&1; then
         _notrun "cannot mkfs zoned filesystem"
+fi
  _mount $zloop $mnt

  $FSX_PROG -q -N 20000 $FSX_AVOID "$mnt/fsx" >> $seqres.full
root@feddev:/Volumes/work/ws/fstests$
----------------------------




On 13-Oct-25 4:07 PM, Johannes Thumshirn wrote:
> Add a basic smoke test for filesystems that support running on zoned
> block devices.
> 
> It creates a zloop device with 2 conventional and 62 sequential zones,
> mounts it and then runs fsx on it.
> 
> Currently this tests supports BTRFS, F2FS and XFS.
> 
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>   tests/generic/772     | 49 +++++++++++++++++++++++++++++++++++++++++++
>   tests/generic/772.out |  2 ++
>   2 files changed, 51 insertions(+)
>   create mode 100755 tests/generic/772
>   create mode 100644 tests/generic/772.out
> 
> diff --git a/tests/generic/772 b/tests/generic/772
> new file mode 100755
> index 00000000..d9b84614
> --- /dev/null
> +++ b/tests/generic/772
> @@ -0,0 +1,49 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Wesgtern Digital Corporation.  All Rights Reserved.
> +#
> +# FS QA Test 772
> +#
> +# Smoke test for FSes with ZBD support on zloop
> +#
> +. ./common/preamble
> +_begin_fstest auto zone quick
> +
> +_cleanup()
> +{
> +	if test -b /dev/zloop$ID; then
> +		echo "remove id=$ID" > /dev/zloop-control
> +	fi
> +}
> +
> +. ./common/zoned
> +
> +# Modify as appropriate.
> +_require_scratch
> +_require_scratch_size $((16 * 1024 * 1024)) #kB
> +_require_zloop
> +
> +_scratch_mkfs > /dev/null 2>&1
> +_scratch_mount
> +
> +ID=$(_find_next_zloop)
> +
> +mnt="$SCRATCH_MNT/mnt"
> +zloopdir="$SCRATCH_MNT/zloop"
> +
> +mkdir -p "$zloopdir/$ID"
> +mkdir -p $mnt
> +_create_zloop $ID $zloopdir 256 2
> +zloop="/dev/zloop$ID"
> +
> +_try_mkfs_dev $zloop 2>&1 >> $seqres.full ||\
> +	_notrun "cannot mkfs zoned filesystem"
> +_mount $zloop $mnt
> +
> +$FSX_PROG -q -N 20000 $FSX_AVOID "$mnt/fsx" >> $seqres.full
> +
> +umount $mnt
> +
> +echo Silence is golden
> +# success, all done
> +_exit 0
> diff --git a/tests/generic/772.out b/tests/generic/772.out
> new file mode 100644
> index 00000000..98c13968
> --- /dev/null
> +++ b/tests/generic/772.out
> @@ -0,0 +1,2 @@
> +QA output created by 772
> +Silence is golden


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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13 13:55   ` Anand Jain
@ 2025-10-13 14:06     ` Johannes Thumshirn
  2025-10-13 14:42       ` Anand Jain
  0 siblings, 1 reply; 14+ messages in thread
From: Johannes Thumshirn @ 2025-10-13 14:06 UTC (permalink / raw)
  To: Anand Jain, Zorro Lang
  Cc: hch, Naohiro Aota, linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino

On 10/13/25 3:55 PM, Anand Jain wrote:
> Johannes,
>
> The test case is failing with XFS. For some reason, the mkfs error
> wasn't captured in the output, so I had to modify the test slightly.
> Errors and the diff is below.
>
> Thanks, Anand
>
> -------
> SECTION       -- generic-config
> RECREATING    -- xfs on /dev/sde
> FSTYP         -- xfs (non-debug)
> PLATFORM      -- Linux/x86_64 feddev 6.16.10-100.fc41.x86_64 #1 SMP
> PREEMPT_DYNAMIC Thu Oct  2 18:19:14 UTC 2025
> MKFS_OPTIONS  -- -f /dev/sda
> MOUNT_OPTIONS -- /dev/sda /mnt/scratch
>
> generic/772       [not run] cannot mkfs zoned filesystem
> Ran: generic/772
> Not run: generic/772
> Passed all 1 tests

Hi Anand,

Looking at the output it isn't failing but skipped on your XFS config.


This is expected if XFS isn't build with support for the zoned realtime 
device. I've been discussing this with Christoph, because for XFS there 
is no feature flag in sysfs we can check if the kernel can actually 
support a zoned RT device (unlike f2fs or btrfs which do have this in 
sysfs).

Christoph's idea was to do exactly this, if no zoned RT support is 
compiled in the kernel. Hence the _try_mkfs_dev instead of a plain 
_mkfs_dev call.

So I /think/ you just validated that the skip if !CONFIG_BLK_DEV_ZONED 
&& !CONFIG_XFS_RT check works.

Thanks,

Johannes


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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13 14:06     ` Johannes Thumshirn
@ 2025-10-13 14:42       ` Anand Jain
  2025-10-14  4:30         ` hch
  0 siblings, 1 reply; 14+ messages in thread
From: Anand Jain @ 2025-10-13 14:42 UTC (permalink / raw)
  To: Johannes Thumshirn, Zorro Lang
  Cc: hch, Naohiro Aota, linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino



On 13-Oct-25 10:06 PM, Johannes Thumshirn wrote:
> On 10/13/25 3:55 PM, Anand Jain wrote:
>> Johannes,
>>
>> The test case is failing with XFS. For some reason, the mkfs error
>> wasn't captured in the output, so I had to modify the test slightly.
>> Errors and the diff is below.
>>
>> Thanks, Anand
>>
>> -------
>> SECTION       -- generic-config
>> RECREATING    -- xfs on /dev/sde
>> FSTYP         -- xfs (non-debug)
>> PLATFORM      -- Linux/x86_64 feddev 6.16.10-100.fc41.x86_64 #1 SMP
>> PREEMPT_DYNAMIC Thu Oct  2 18:19:14 UTC 2025
>> MKFS_OPTIONS  -- -f /dev/sda
>> MOUNT_OPTIONS -- /dev/sda /mnt/scratch
>>
>> generic/772       [not run] cannot mkfs zoned filesystem
>> Ran: generic/772
>> Not run: generic/772
>> Passed all 1 tests
> 
> Hi Anand,
> 
> Looking at the output it isn't failing but skipped on your XFS config.
> 
> 
> This is expected if XFS isn't build with support for the zoned realtime
> device. I've been discussing this with Christoph, because for XFS there
> is no feature flag in sysfs we can check if the kernel can actually
> support a zoned RT device (unlike f2fs or btrfs which do have this in
> sysfs).
> 
> Christoph's idea was to do exactly this, if no zoned RT support is
> compiled in the kernel. Hence the _try_mkfs_dev instead of a plain
> _mkfs_dev call.
> 
> So I /think/ you just validated that the skip if !CONFIG_BLK_DEV_ZONED
> && !CONFIG_XFS_RT check works.
> 

Ah, thanks for clarifying. Any idea if the redirect to seqres.full can 
be fixed? It was missing the mkfs errors.

Best, Anand


> Thanks,
> 
> Johannes
> 


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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13 14:42       ` Anand Jain
@ 2025-10-14  4:30         ` hch
  2025-10-14 14:38           ` Anand Jain
  0 siblings, 1 reply; 14+ messages in thread
From: hch @ 2025-10-14  4:30 UTC (permalink / raw)
  To: Anand Jain
  Cc: Johannes Thumshirn, Zorro Lang, hch, Naohiro Aota,
	linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino

On Mon, Oct 13, 2025 at 10:42:03PM +0800, Anand Jain wrote:
>> So I /think/ you just validated that the skip if !CONFIG_BLK_DEV_ZONED
>> && !CONFIG_XFS_RT check works.
>>
>
> Ah, thanks for clarifying. Any idea if the redirect to seqres.full can be 
> fixed? It was missing the mkfs errors.

With "fixed" you mean not having the mkfs errors in $seqres.full?  It's
kinda useful to have the messages there to see why the test wasn't run.
What speaks against having the messages logged?


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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-13  8:07 ` [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices Johannes Thumshirn
  2025-10-13 13:55   ` Anand Jain
@ 2025-10-14  4:33   ` Christoph Hellwig
  1 sibling, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2025-10-14  4:33 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Zorro Lang, Christoph Hellwig, Naohiro Aota, linux-btrfs,
	Hans Holmberg, fstests, linux-xfs, Carlos Maiolino,
	Darrick J . Wong, Carlos Maiolino

On Mon, Oct 13, 2025 at 10:07:59AM +0200, Johannes Thumshirn wrote:
> +_cleanup()
> +{
> +	if test -b /dev/zloop$ID; then
> +		echo "remove id=$ID" > /dev/zloop-control
> +	fi
> +}

> +mkdir -p "$zloopdir/$ID"
> +mkdir -p $mnt
> +_create_zloop $ID $zloopdir 256 2
> +zloop="/dev/zloop$ID"

To got back to my comments on the first round (sorry, slow to catch up
due to conference travel)+, I would expect most of this to be
in common/zloop helpers, i.e. have a helper that has basically all
the code in the cleanup helper except that it gets passed the ID, and
also have the +mkdir -p "$zloopdir/$ID" indluded in _create_zloop.
And maybe _create_zloop should also return the device name, turning
the above into

zloop=`_create_next_zloop $zloopdir 256 2`

?

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

* Re: [PATCH v3 1/3] common/zoned: add _require_zloop
  2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
  2025-10-13  8:43   ` Naohiro Aota
@ 2025-10-14  4:33   ` Christoph Hellwig
  1 sibling, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2025-10-14  4:33 UTC (permalink / raw)
  To: Johannes Thumshirn
  Cc: Zorro Lang, Christoph Hellwig, Naohiro Aota, linux-btrfs,
	Hans Holmberg, fstests, linux-xfs, Carlos Maiolino,
	Darrick J . Wong, Carlos Maiolino

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


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

* Re: [PATCH v3 2/3] common/zoned: add _create_zloop
  2025-10-13  8:07 ` [PATCH v3 2/3] common/zoned: add _create_zloop Johannes Thumshirn
@ 2025-10-14  9:04   ` Naohiro Aota
  0 siblings, 0 replies; 14+ messages in thread
From: Naohiro Aota @ 2025-10-14  9:04 UTC (permalink / raw)
  To: Johannes Thumshirn, Zorro Lang
  Cc: hch, Naohiro Aota, linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong

On Mon Oct 13, 2025 at 5:07 PM JST, Johannes Thumshirn wrote:
> Add _create_zloop a helper function for creating a zloop device.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  common/zoned | 29 +++++++++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>
> diff --git a/common/zoned b/common/zoned
> index 41697b08..59bebcae 100644
> --- a/common/zoned
> +++ b/common/zoned
> @@ -45,3 +45,32 @@ _require_zloop()
>  	    _notrun "This test requires zoned loopback device support"
>      fi
>  }
> +
> +_find_next_zloop()
> +{
> +    local last_id=$(ls /dev/zloop* 2> /dev/null | grep -E "zloop[0-9]+" | wc -l)
> +    echo $last_id
> +}

This one does not work if well one of a non-end zloop device is removed.
So, how about something like this?

while true; do
	if [[ ! -b /dev/zloop$id ]]; then
		break
	fi
	id=$(( id + 1 ))
done

> +
> +# Create a zloop device
> +# useage: _create_zloop [id] <base_dir> <zone_size> <nr_conv_zones>
> +_create_zloop()

Thinking of the compatibility with _create_loop_device(), it would be good
to return the device name.

> +{
> +    local id=$1

So, I think we can just grab an ID here as above, and

> +
> +    if [ -n "$2" ]; then
> +        local base_dir=",base_dir=$2"
> +    fi
> +
> +    if [ -n "$3" ]; then
> +        local zone_size=",zone_size_mb=$3"
> +    fi
> +
> +    if [ -n "$4" ]; then
> +        local conv_zones=",conv_zones=$4"
> +    fi

mkdir -p $base_dir/$id here. I think it's enough to run a workload on an empty
zloop device.

Or, should we also support creating a zloop device from an existing file
structure?

> +
> +    local zloop_args="add id=$id$base_dir$zone_size$conv_zones"
> +
> +    echo "$zloop_args" > /dev/zloop-control
> +}

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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-14  4:30         ` hch
@ 2025-10-14 14:38           ` Anand Jain
  2025-10-15  4:09             ` hch
  0 siblings, 1 reply; 14+ messages in thread
From: Anand Jain @ 2025-10-14 14:38 UTC (permalink / raw)
  To: hch
  Cc: Johannes Thumshirn, Zorro Lang, Naohiro Aota,
	linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino



On 14-Oct-25 12:30 PM, hch wrote:
> On Mon, Oct 13, 2025 at 10:42:03PM +0800, Anand Jain wrote:
>>> So I /think/ you just validated that the skip if !CONFIG_BLK_DEV_ZONED
>>> && !CONFIG_XFS_RT check works.
>>>
>>
>> Ah, thanks for clarifying. Any idea if the redirect to seqres.full can be
>> fixed? It was missing the mkfs errors.
> 
> With "fixed" you mean not having the mkfs errors in $seqres.full?  It's
> kinda useful to have the messages there to see why the test wasn't run.
> What speaks against having the messages logged?
> 

Right now (v3) the errors are going to stdout instead
of $seqres.full. I was thinking it'd be cleaner if they
went to $seqres.full instead.

Now:
   _try_mkfs_dev $zloop 2>&1 >> $seqres.full ||

Suggested:
   _try_mkfs_dev $zloop >> $seqres.full 2>&1 ||

Best. Anand

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

* Re: [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices
  2025-10-14 14:38           ` Anand Jain
@ 2025-10-15  4:09             ` hch
  0 siblings, 0 replies; 14+ messages in thread
From: hch @ 2025-10-15  4:09 UTC (permalink / raw)
  To: Anand Jain
  Cc: hch, Johannes Thumshirn, Zorro Lang, Naohiro Aota,
	linux-btrfs@vger.kernel.org, Hans Holmberg,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
	Carlos Maiolino, Darrick J . Wong, Carlos Maiolino

On Tue, Oct 14, 2025 at 10:38:55PM +0800, Anand Jain wrote:
> Right now (v3) the errors are going to stdout instead
> of $seqres.full. I was thinking it'd be cleaner if they
> went to $seqres.full instead.
>
> Now:
>   _try_mkfs_dev $zloop 2>&1 >> $seqres.full ||
>
> Suggested:
>   _try_mkfs_dev $zloop >> $seqres.full 2>&1 ||
>
> Best. Anand

Yes, that makes sense.  Sorry for being so dense.

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

end of thread, other threads:[~2025-10-15  4:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13  8:07 [PATCH v3 0/3] fstests: basic smoke test on zoned loop device Johannes Thumshirn
2025-10-13  8:07 ` [PATCH v3 1/3] common/zoned: add _require_zloop Johannes Thumshirn
2025-10-13  8:43   ` Naohiro Aota
2025-10-14  4:33   ` Christoph Hellwig
2025-10-13  8:07 ` [PATCH v3 2/3] common/zoned: add _create_zloop Johannes Thumshirn
2025-10-14  9:04   ` Naohiro Aota
2025-10-13  8:07 ` [PATCH v3 3/3] generic: basic smoke for filesystems on zoned block devices Johannes Thumshirn
2025-10-13 13:55   ` Anand Jain
2025-10-13 14:06     ` Johannes Thumshirn
2025-10-13 14:42       ` Anand Jain
2025-10-14  4:30         ` hch
2025-10-14 14:38           ` Anand Jain
2025-10-15  4:09             ` hch
2025-10-14  4:33   ` Christoph Hellwig

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