* [PATCH 0/2] xfs: add regression test for small zone capacity @ 2025-11-20 16:08 cem 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem 0 siblings, 2 replies; 17+ messages in thread From: cem @ 2025-11-20 16:08 UTC (permalink / raw) To: zlang; +Cc: hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs From: Carlos Maiolino <cem@kernel.org> This adds a regression test for the smaller sequential zone capacities problem. For that, we need to be able to create a zoned loop device with a custom capacity, so the first patch extents _create_zloop to accept a custom zone capacity. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Carlos Maiolino (2): common/zoned: enable passing a custom capacity xfs: Add test for mkfs with smaller zone capacity common/zoned | 8 ++++++-- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.out -- 2.51.1 ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/2] common/zoned: enable passing a custom capacity 2025-11-20 16:08 [PATCH 0/2] xfs: add regression test for small zone capacity cem @ 2025-11-20 16:08 ` cem 2025-11-21 6:46 ` Johannes Thumshirn ` (2 more replies) 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem 1 sibling, 3 replies; 17+ messages in thread From: cem @ 2025-11-20 16:08 UTC (permalink / raw) To: zlang; +Cc: hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs From: Carlos Maiolino <cem@kernel.org> Extend _create_zloop() to accept a custom zone capacity. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> --- common/zoned | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/zoned b/common/zoned index 88b81de5db4d..51c011b247d2 100644 --- a/common/zoned +++ b/common/zoned @@ -61,7 +61,7 @@ _find_next_zloop() } # Create a zloop device -# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> +# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> <zone_capacity> _create_zloop() { local id="$(_find_next_zloop)" @@ -80,9 +80,13 @@ _create_zloop() local conv_zones=",conv_zones=$3" fi + if [ -n "$4" ]; then + local zone_capacity=",zone_capacity_mb=$4" + fi + mkdir -p "$zloop_base/$id" - local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones" + local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones$zone_capacity" echo "$zloop_args" > /dev/zloop-control || \ _fail "cannot create zloop device" -- 2.51.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] common/zoned: enable passing a custom capacity 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem @ 2025-11-21 6:46 ` Johannes Thumshirn 2025-11-21 6:50 ` Christoph Hellwig 2025-11-22 7:41 ` Zorro Lang 2 siblings, 0 replies; 17+ messages in thread From: Johannes Thumshirn @ 2025-11-21 6:46 UTC (permalink / raw) To: cem@kernel.org, zlang@kernel.org Cc: hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org Looks good, Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] common/zoned: enable passing a custom capacity 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem 2025-11-21 6:46 ` Johannes Thumshirn @ 2025-11-21 6:50 ` Christoph Hellwig 2025-11-22 7:41 ` Zorro Lang 2 siblings, 0 replies; 17+ messages in thread From: Christoph Hellwig @ 2025-11-21 6:50 UTC (permalink / raw) To: cem; +Cc: zlang, hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 1/2] common/zoned: enable passing a custom capacity 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem 2025-11-21 6:46 ` Johannes Thumshirn 2025-11-21 6:50 ` Christoph Hellwig @ 2025-11-22 7:41 ` Zorro Lang 2 siblings, 0 replies; 17+ messages in thread From: Zorro Lang @ 2025-11-22 7:41 UTC (permalink / raw) To: cem; +Cc: zlang, hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs On Thu, Nov 20, 2025 at 05:08:29PM +0100, cem@kernel.org wrote: > From: Carlos Maiolino <cem@kernel.org> > > Extend _create_zloop() to accept a custom zone capacity. > > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> > --- > common/zoned | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/common/zoned b/common/zoned > index 88b81de5db4d..51c011b247d2 100644 > --- a/common/zoned > +++ b/common/zoned > @@ -61,7 +61,7 @@ _find_next_zloop() > } > > # Create a zloop device > -# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> > +# usage: _create_zloop <base_dir> <zone_size> <nr_conv_zones> <zone_capacity> Actually from the logic of _create_zloop, these 4 arguments are optional, not necessary, so the "<...>" should be "[...]" > _create_zloop() > { > local id="$(_find_next_zloop)" > @@ -80,9 +80,13 @@ _create_zloop() > local conv_zones=",conv_zones=$3" > fi > > + if [ -n "$4" ]; then > + local zone_capacity=",zone_capacity_mb=$4" > + fi > + > mkdir -p "$zloop_base/$id" > > - local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones" > + local zloop_args="add id=$id,base_dir=$zloop_base$zone_size$conv_zones$zone_capacity" If the "zone_capacity" isn't a new feature which need a _require_ helper to check it's supported, then this patch looks good to me. Reviewed-by: Zorro Lang <zlang@redhat.com> > > echo "$zloop_args" > /dev/zloop-control || \ > _fail "cannot create zloop device" > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-20 16:08 [PATCH 0/2] xfs: add regression test for small zone capacity cem 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem @ 2025-11-20 16:08 ` cem 2025-11-21 6:51 ` Christoph Hellwig ` (2 more replies) 1 sibling, 3 replies; 17+ messages in thread From: cem @ 2025-11-20 16:08 UTC (permalink / raw) To: zlang; +Cc: hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs From: Carlos Maiolino <cem@kernel.org> Add a regression test for initializing zoned block devices with sequential zones with a capacity smaller than the conventional zones capacity. Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> --- tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ tests/xfs/333.out | 2 ++ 2 files changed, 39 insertions(+) create mode 100755 tests/xfs/333 create mode 100644 tests/xfs/333.out diff --git a/tests/xfs/333 b/tests/xfs/333 new file mode 100755 index 000000000000..f045b13c73ee --- /dev/null +++ b/tests/xfs/333 @@ -0,0 +1,37 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 333 +# +# Test that mkfs can properly initialize zoned devices +# with a sequential zone capacity smaller than the conventional zone. +# +. ./common/preamble +. ./common/zoned + +_begin_fstest auto zone mkfs quick +_cleanup() +{ + _destroy_zloop $zloop +} + +_require_scratch +_require_zloop + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount >> $seqres.full + +zloopdir="$SCRATCH_MNT/zloop" +zone_size=64 +conv_zones=2 +zone_capacity=63 + +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) + +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ + _fail "Cannot mkfs zoned filesystem" + +echo Silence is golden +# success, all done +_exit 0 diff --git a/tests/xfs/333.out b/tests/xfs/333.out new file mode 100644 index 000000000000..60a158987a22 --- /dev/null +++ b/tests/xfs/333.out @@ -0,0 +1,2 @@ +QA output created by 333 +Silence is golden -- 2.51.1 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem @ 2025-11-21 6:51 ` Christoph Hellwig 2025-11-21 6:51 ` Johannes Thumshirn 2025-11-22 8:36 ` Zorro Lang 2 siblings, 0 replies; 17+ messages in thread From: Christoph Hellwig @ 2025-11-21 6:51 UTC (permalink / raw) To: cem; +Cc: zlang, hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem 2025-11-21 6:51 ` Christoph Hellwig @ 2025-11-21 6:51 ` Johannes Thumshirn 2025-11-21 6:57 ` hch 2025-11-24 15:27 ` Carlos Maiolino 2025-11-22 8:36 ` Zorro Lang 2 siblings, 2 replies; 17+ messages in thread From: Johannes Thumshirn @ 2025-11-21 6:51 UTC (permalink / raw) To: cem@kernel.org, zlang@kernel.org Cc: hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On 11/20/25 5:09 PM, cem@kernel.org wrote: > From: Carlos Maiolino <cem@kernel.org> > > Add a regression test for initializing zoned block devices with > sequential zones with a capacity smaller than the conventional > zones capacity. Hi Carlos, Two quick questions: 1) Is there a specific reason this is a xfs only test? I think checking this on btrfs and f2fs would make sense as well, like with generic/781. 2) I would also mount the FS and perform some IO on it. > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> > --- > tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ > tests/xfs/333.out | 2 ++ > 2 files changed, 39 insertions(+) > create mode 100755 tests/xfs/333 > create mode 100644 tests/xfs/333.out > > diff --git a/tests/xfs/333 b/tests/xfs/333 > new file mode 100755 > index 000000000000..f045b13c73ee > --- /dev/null > +++ b/tests/xfs/333 > @@ -0,0 +1,37 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. > +# > +# FS QA Test 333 > +# > +# Test that mkfs can properly initialize zoned devices > +# with a sequential zone capacity smaller than the conventional zone. > +# > +. ./common/preamble > +. ./common/zoned > + > +_begin_fstest auto zone mkfs quick > +_cleanup() > +{ > + _destroy_zloop $zloop > +} > + > +_require_scratch > +_require_zloop > + > +_scratch_mkfs > /dev/null 2>&1 > +_scratch_mount >> $seqres.full > + > +zloopdir="$SCRATCH_MNT/zloop" > +zone_size=64 > +conv_zones=2 > +zone_capacity=63 > + > +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) > + > +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ > + _fail "Cannot mkfs zoned filesystem" > + > +echo Silence is golden > +# success, all done > +_exit 0 > diff --git a/tests/xfs/333.out b/tests/xfs/333.out > new file mode 100644 > index 000000000000..60a158987a22 > --- /dev/null > +++ b/tests/xfs/333.out > @@ -0,0 +1,2 @@ > +QA output created by 333 > +Silence is golden ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-21 6:51 ` Johannes Thumshirn @ 2025-11-21 6:57 ` hch 2025-11-21 7:00 ` Johannes Thumshirn 2025-11-24 15:27 ` Carlos Maiolino 1 sibling, 1 reply; 17+ messages in thread From: hch @ 2025-11-21 6:57 UTC (permalink / raw) To: Johannes Thumshirn Cc: cem@kernel.org, zlang@kernel.org, hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: > On 11/20/25 5:09 PM, cem@kernel.org wrote: > > From: Carlos Maiolino <cem@kernel.org> > > > > Add a regression test for initializing zoned block devices with > > sequential zones with a capacity smaller than the conventional > > zones capacity. > > > Hi Carlos, > > Two quick questions: > > 1) Is there a specific reason this is a xfs only test? I think checking > this on btrfs and f2fs would make sense as well, like with generic/781. Didn't f2fs drop zone_capacity < zone_size support because they only care about their android out of tree use case? But otherwise I'd agree. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-21 6:57 ` hch @ 2025-11-21 7:00 ` Johannes Thumshirn 2025-11-21 8:34 ` Hans Holmberg 0 siblings, 1 reply; 17+ messages in thread From: Johannes Thumshirn @ 2025-11-21 7:00 UTC (permalink / raw) To: hch Cc: cem@kernel.org, zlang@kernel.org, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On 11/21/25 7:57 AM, hch wrote: > On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: >> On 11/20/25 5:09 PM, cem@kernel.org wrote: >>> From: Carlos Maiolino <cem@kernel.org> >>> >>> Add a regression test for initializing zoned block devices with >>> sequential zones with a capacity smaller than the conventional >>> zones capacity. >> >> Hi Carlos, >> >> Two quick questions: >> >> 1) Is there a specific reason this is a xfs only test? I think checking >> this on btrfs and f2fs would make sense as well, like with generic/781. > Didn't f2fs drop zone_capacity < zone_size support because they only > care about their android out of tree use case? > > But otherwise I'd agree. > That one I actually don't know ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-21 7:00 ` Johannes Thumshirn @ 2025-11-21 8:34 ` Hans Holmberg 0 siblings, 0 replies; 17+ messages in thread From: Hans Holmberg @ 2025-11-21 8:34 UTC (permalink / raw) To: Johannes Thumshirn, hch, Bart Van Assche Cc: cem@kernel.org, zlang@kernel.org, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On 21/11/2025 08:00, Johannes Thumshirn wrote: > On 11/21/25 7:57 AM, hch wrote: >> On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: >>> On 11/20/25 5:09 PM, cem@kernel.org wrote: >>>> From: Carlos Maiolino <cem@kernel.org> >>>> >>>> Add a regression test for initializing zoned block devices with >>>> sequential zones with a capacity smaller than the conventional >>>> zones capacity. >>> >>> Hi Carlos, >>> >>> Two quick questions: >>> >>> 1) Is there a specific reason this is a xfs only test? I think checking >>> this on btrfs and f2fs would make sense as well, like with generic/781. >> Didn't f2fs drop zone_capacity < zone_size support because they only >> care about their android out of tree use case? >> >> But otherwise I'd agree. >> > That one I actually don't know > > + Bart I've been benchmarking f2fs with zone capacity < zone size lately on SSD devices, so i'd be surprised if that has stopped working (but that requires a separate blockdev for metadata (e.g. a separate name space) Single-zoned-device f2fs file systems also works: mkfs.f2fs -m /dev/<host managed smr disk> (but that has zone_size==cone_capacity) ..so i think this should be applicable for f2fs as well ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-21 6:51 ` Johannes Thumshirn 2025-11-21 6:57 ` hch @ 2025-11-24 15:27 ` Carlos Maiolino 2025-11-24 17:31 ` Johannes Thumshirn 1 sibling, 1 reply; 17+ messages in thread From: Carlos Maiolino @ 2025-11-24 15:27 UTC (permalink / raw) To: Johannes Thumshirn Cc: zlang@kernel.org, hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: > On 11/20/25 5:09 PM, cem@kernel.org wrote: > > From: Carlos Maiolino <cem@kernel.org> > > > > Add a regression test for initializing zoned block devices with > > sequential zones with a capacity smaller than the conventional > > zones capacity. > > > Hi Carlos, > > Two quick questions: > > 1) Is there a specific reason this is a xfs only test? I think checking > this on btrfs and f2fs would make sense as well, like with generic/781. I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't think there is any reason for this to be xfs-specific. > > 2) I would also mount the FS and perform some IO on it. I'm not sure about this. Do you have any purpose in mind? This is specifically to test mkfs is able to properly format the filesystem, not to try the kernel module per-se. One could argue that something 'could' go wrong in the mkfs that might be found out only via some IO, but that would require much more than just 'some IO'. I do think a mount/unmount might add some value to the test, but I fail to see why issuing a random amount of I/O would prove the correctness of mkfs properly dealing with small capacities. Cheers. Carlos > > > > > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> > > --- > > tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ > > tests/xfs/333.out | 2 ++ > > 2 files changed, 39 insertions(+) > > create mode 100755 tests/xfs/333 > > create mode 100644 tests/xfs/333.out > > > > diff --git a/tests/xfs/333 b/tests/xfs/333 > > new file mode 100755 > > index 000000000000..f045b13c73ee > > --- /dev/null > > +++ b/tests/xfs/333 > > @@ -0,0 +1,37 @@ > > +#! /bin/bash > > +# SPDX-License-Identifier: GPL-2.0 > > +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. > > +# > > +# FS QA Test 333 > > +# > > +# Test that mkfs can properly initialize zoned devices > > +# with a sequential zone capacity smaller than the conventional zone. > > +# > > +. ./common/preamble > > +. ./common/zoned > > + > > +_begin_fstest auto zone mkfs quick > > +_cleanup() > > +{ > > + _destroy_zloop $zloop > > +} > > + > > +_require_scratch > > +_require_zloop > > + > > +_scratch_mkfs > /dev/null 2>&1 > > +_scratch_mount >> $seqres.full > > + > > +zloopdir="$SCRATCH_MNT/zloop" > > +zone_size=64 > > +conv_zones=2 > > +zone_capacity=63 > > + > > +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) > > + > > +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ > > + _fail "Cannot mkfs zoned filesystem" > > + > > +echo Silence is golden > > +# success, all done > > +_exit 0 > > diff --git a/tests/xfs/333.out b/tests/xfs/333.out > > new file mode 100644 > > index 000000000000..60a158987a22 > > --- /dev/null > > +++ b/tests/xfs/333.out > > @@ -0,0 +1,2 @@ > > +QA output created by 333 > > +Silence is golden > > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-24 15:27 ` Carlos Maiolino @ 2025-11-24 17:31 ` Johannes Thumshirn 2025-11-24 17:34 ` hch 2025-11-25 13:01 ` Carlos Maiolino 0 siblings, 2 replies; 17+ messages in thread From: Johannes Thumshirn @ 2025-11-24 17:31 UTC (permalink / raw) To: Carlos Maiolino Cc: zlang@kernel.org, hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On 11/24/25 4:27 PM, Carlos Maiolino wrote: > On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: >> On 11/20/25 5:09 PM, cem@kernel.org wrote: >>> From: Carlos Maiolino <cem@kernel.org> >>> >>> Add a regression test for initializing zoned block devices with >>> sequential zones with a capacity smaller than the conventional >>> zones capacity. >> >> Hi Carlos, >> >> Two quick questions: >> >> 1) Is there a specific reason this is a xfs only test? I think checking >> this on btrfs and f2fs would make sense as well, like with generic/781. > I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't > think there is any reason for this to be xfs-specific. > >> 2) I would also mount the FS and perform some IO on it. > I'm not sure about this. Do you have any purpose in mind? This is > specifically to test mkfs is able to properly format the filesystem, not > to try the kernel module per-se. > One could argue that something 'could' go wrong in the mkfs that might > be found out only via some IO, but that would require much more than > just 'some IO'. Yep that's what I had in mind. > I do think a mount/unmount might add some value to the test, but I fail > to see why issuing a random amount of I/O would prove the correctness of > mkfs properly dealing with small capacities. fstests does a fsck after each test, doesn't it? So that should be sufficient as well. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-24 17:31 ` Johannes Thumshirn @ 2025-11-24 17:34 ` hch 2025-11-25 13:01 ` Carlos Maiolino 1 sibling, 0 replies; 17+ messages in thread From: hch @ 2025-11-24 17:34 UTC (permalink / raw) To: Johannes Thumshirn Cc: Carlos Maiolino, zlang@kernel.org, hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On Mon, Nov 24, 2025 at 05:31:03PM +0000, Johannes Thumshirn wrote: > > I do think a mount/unmount might add some value to the test, but I fail > > to see why issuing a random amount of I/O would prove the correctness of > > mkfs properly dealing with small capacities. > > > fstests does a fsck after each test, doesn't it? So that should be > sufficient as well. But only for well defined devices, not those made up from thin air. So we'd need to do that manually here. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-24 17:31 ` Johannes Thumshirn 2025-11-24 17:34 ` hch @ 2025-11-25 13:01 ` Carlos Maiolino 1 sibling, 0 replies; 17+ messages in thread From: Carlos Maiolino @ 2025-11-25 13:01 UTC (permalink / raw) To: Johannes Thumshirn Cc: zlang@kernel.org, hch, Hans Holmberg, fstests@vger.kernel.org, linux-xfs@vger.kernel.org On Mon, Nov 24, 2025 at 05:31:03PM +0000, Johannes Thumshirn wrote: > On 11/24/25 4:27 PM, Carlos Maiolino wrote: > > On Fri, Nov 21, 2025 at 06:51:31AM +0000, Johannes Thumshirn wrote: > >> On 11/20/25 5:09 PM, cem@kernel.org wrote: > >>> From: Carlos Maiolino <cem@kernel.org> > >>> > >>> Add a regression test for initializing zoned block devices with > >>> sequential zones with a capacity smaller than the conventional > >>> zones capacity. > >> > >> Hi Carlos, > >> > >> Two quick questions: > >> > >> 1) Is there a specific reason this is a xfs only test? I think checking > >> this on btrfs and f2fs would make sense as well, like with generic/781. > > I wrote this mostly as a regression test for xfs's mkfs, but yeah, I don't > > think there is any reason for this to be xfs-specific. > > > >> 2) I would also mount the FS and perform some IO on it. > > I'm not sure about this. Do you have any purpose in mind? This is > > specifically to test mkfs is able to properly format the filesystem, not > > to try the kernel module per-se. > > One could argue that something 'could' go wrong in the mkfs that might > > be found out only via some IO, but that would require much more than > > just 'some IO'. > > > Yep that's what I had in mind. > > > > I do think a mount/unmount might add some value to the test, but I fail > > to see why issuing a random amount of I/O would prove the correctness of > > mkfs properly dealing with small capacities. > > > fstests does a fsck after each test, doesn't it? So that should be > sufficient as well. > I particularly don't agree with mounting/unmounting the FS here, that extends the test to more than it is supposed to test, i.e. ensuring mkfs can initialize the filesystem. Although I agree running fsck on it to certify nothing obviously wrong happened with mkfs. I think I've got another bug though which I started to investigate a few minutes ago. Reason why I think we should split mkfs and mount/unmount testing into two different tests. Anyway, I'll see what's going on an update this test appropriately for a new version. Thanks for the reviews. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem 2025-11-21 6:51 ` Christoph Hellwig 2025-11-21 6:51 ` Johannes Thumshirn @ 2025-11-22 8:36 ` Zorro Lang 2025-11-24 16:04 ` Carlos Maiolino 2 siblings, 1 reply; 17+ messages in thread From: Zorro Lang @ 2025-11-22 8:36 UTC (permalink / raw) To: cem; +Cc: zlang, hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs On Thu, Nov 20, 2025 at 05:08:30PM +0100, cem@kernel.org wrote: > From: Carlos Maiolino <cem@kernel.org> > > Add a regression test for initializing zoned block devices with > sequential zones with a capacity smaller than the conventional > zones capacity. > > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> > --- > tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ > tests/xfs/333.out | 2 ++ > 2 files changed, 39 insertions(+) > create mode 100755 tests/xfs/333 > create mode 100644 tests/xfs/333.out > > diff --git a/tests/xfs/333 b/tests/xfs/333 > new file mode 100755 > index 000000000000..f045b13c73ee > --- /dev/null > +++ b/tests/xfs/333 > @@ -0,0 +1,37 @@ > +#! /bin/bash > +# SPDX-License-Identifier: GPL-2.0 > +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. > +# > +# FS QA Test 333 > +# > +# Test that mkfs can properly initialize zoned devices > +# with a sequential zone capacity smaller than the conventional zone. > +# > +. ./common/preamble > +. ./common/zoned > + > +_begin_fstest auto zone mkfs quick > +_cleanup() > +{ > + _destroy_zloop $zloop cd / rm -r -f $tmp.* > +} > + > +_require_scratch _require_block_device $SCRATCH_DEV > +_require_zloop g/781 checks if current $FSTYP supports zoned filesystem, and _notrun if it's not supported: _try_mkfs_dev $zloop >> $seqres.full 2>&1 ||\ _notrun "cannot mkfs zoned filesystem" I'm wondering if we could have a common helper for that, then this case can be a generic test case too. For example: _require_zloop_filesystem() { _require_zloop local zloopdir="$TEST_DIR/zloop_test" local zloop=$(_create_zloop $zloopdir 64 2) _try_mkfs_dev $zloop >/dev/null 2>&1 || \ _notrun "cannot make $FSTYP on zloop" _destroy_zloop $zloop } But this method takes too much time to run, does anyone have a better idea to help it to be finished in several seconds? > + > +_scratch_mkfs > /dev/null 2>&1 > +_scratch_mount >> $seqres.full > + > +zloopdir="$SCRATCH_MNT/zloop" > +zone_size=64 > +conv_zones=2 > +zone_capacity=63 Better to add a comment to explain what are these numbers for. > + > +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) > + > +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ > + _fail "Cannot mkfs zoned filesystem" > + > +echo Silence is golden Is this done? If such zloop device can be created, should we expect it works as usual? Thanks, Zorro > +# success, all done > +_exit 0 > diff --git a/tests/xfs/333.out b/tests/xfs/333.out > new file mode 100644 > index 000000000000..60a158987a22 > --- /dev/null > +++ b/tests/xfs/333.out > @@ -0,0 +1,2 @@ > +QA output created by 333 > +Silence is golden > -- > 2.51.1 > ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity 2025-11-22 8:36 ` Zorro Lang @ 2025-11-24 16:04 ` Carlos Maiolino 0 siblings, 0 replies; 17+ messages in thread From: Carlos Maiolino @ 2025-11-24 16:04 UTC (permalink / raw) To: Zorro Lang Cc: zlang, hch, hans.holmberg, johannes.thumshirn, fstests, linux-xfs On Sat, Nov 22, 2025 at 04:36:46PM +0800, Zorro Lang wrote: > On Thu, Nov 20, 2025 at 05:08:30PM +0100, cem@kernel.org wrote: > > From: Carlos Maiolino <cem@kernel.org> > > > > Add a regression test for initializing zoned block devices with > > sequential zones with a capacity smaller than the conventional > > zones capacity. > > > > Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> > > --- > > tests/xfs/333 | 37 +++++++++++++++++++++++++++++++++++++ > > tests/xfs/333.out | 2 ++ > > 2 files changed, 39 insertions(+) > > create mode 100755 tests/xfs/333 > > create mode 100644 tests/xfs/333.out > > > > diff --git a/tests/xfs/333 b/tests/xfs/333 > > new file mode 100755 > > index 000000000000..f045b13c73ee > > --- /dev/null > > +++ b/tests/xfs/333 > > @@ -0,0 +1,37 @@ > > +#! /bin/bash > > +# SPDX-License-Identifier: GPL-2.0 > > +# Copyright (c) 2025 Red Hat, Inc. All Rights Reserved. > > +# > > +# FS QA Test 333 > > +# > > +# Test that mkfs can properly initialize zoned devices > > +# with a sequential zone capacity smaller than the conventional zone. > > +# > > +. ./common/preamble > > +. ./common/zoned > > + > > +_begin_fstest auto zone mkfs quick > > +_cleanup() > > +{ > > + _destroy_zloop $zloop > > cd / > rm -r -f $tmp.* > > > +} > > + > > +_require_scratch > > _require_block_device $SCRATCH_DEV I'll add to the V2. > > > +_require_zloop > > g/781 checks if current $FSTYP supports zoned filesystem, and _notrun if it's > not supported: > > _try_mkfs_dev $zloop >> $seqres.full 2>&1 ||\ > _notrun "cannot mkfs zoned filesystem" > > I'm wondering if we could have a common helper for that, then this case can be > a generic test case too. > > For example: > > _require_zloop_filesystem() > { > _require_zloop > > local zloopdir="$TEST_DIR/zloop_test" > local zloop=$(_create_zloop $zloopdir 64 2) > > _try_mkfs_dev $zloop >/dev/null 2>&1 || \ > _notrun "cannot make $FSTYP on zloop" > _destroy_zloop $zloop > } > > But this method takes too much time to run, does anyone have a better idea to help it > to be finished in several seconds? > > > > + > > +_scratch_mkfs > /dev/null 2>&1 > > +_scratch_mount >> $seqres.full > > + > > +zloopdir="$SCRATCH_MNT/zloop" > > +zone_size=64 > > +conv_zones=2 > > +zone_capacity=63 > > Better to add a comment to explain what are these numbers for. Hmm, why? The variable names are very self-descriptive. I could add a comment, but it's just redundant IMHO, ex: zone_size=64 # Set zloop zone size to 64MiB I added the variables instead of passing the numbers directly to _create_zloop to avoid needing to go back and forth to _create_zloop definition and make the meaning clear. I'm fine adding the comments, I just don't see the point. > > > + > > +zloop=$(_create_zloop $zloopdir $zone_size $conv_zones $zone_capacity) > > + > > +_try_mkfs_dev $zloop >> $seqres.full 2>&1 || \ > > + _fail "Cannot mkfs zoned filesystem" > > + > > +echo Silence is golden > > Is this done? If such zloop device can be created, should we expect it works as usual? Yes, the whole point is to ensure mkfs can initialize the filesystem on top of the zoned block device. Cheers, Carlos ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2025-11-25 13:01 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-20 16:08 [PATCH 0/2] xfs: add regression test for small zone capacity cem 2025-11-20 16:08 ` [PATCH 1/2] common/zoned: enable passing a custom capacity cem 2025-11-21 6:46 ` Johannes Thumshirn 2025-11-21 6:50 ` Christoph Hellwig 2025-11-22 7:41 ` Zorro Lang 2025-11-20 16:08 ` [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity cem 2025-11-21 6:51 ` Christoph Hellwig 2025-11-21 6:51 ` Johannes Thumshirn 2025-11-21 6:57 ` hch 2025-11-21 7:00 ` Johannes Thumshirn 2025-11-21 8:34 ` Hans Holmberg 2025-11-24 15:27 ` Carlos Maiolino 2025-11-24 17:31 ` Johannes Thumshirn 2025-11-24 17:34 ` hch 2025-11-25 13:01 ` Carlos Maiolino 2025-11-22 8:36 ` Zorro Lang 2025-11-24 16:04 ` Carlos Maiolino
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox