Re: [PATCH 2/2] xfs: Add test for mkfs with smaller zone capacity

Carlos Maiolino
2025-11-24T15:27:24Z

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
>
>