Re: [PATCH v2] xfs: add a test for number of open zones on conventional devices

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.fstests,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
On Wed, Apr 01, 2026 at 05:18:07AM +0800, Zorro Lang wrote:
> > +
> > +_scratch_mkfs -b size=${bsize} -r zoned=1,rgsize=${blocks}b \
> > +	> "$seqres.full" 2>&1
> 
> I usually tack on "|| _fail 'mkfs failed'" after _scratch_mount if it's
> using extra options. That way, we'll know for sure if the mkfs actually
> failed.

Yes, that is useful here, especially if we want to support older kernels
before the zoned device support or !CONFIG_XFS_RT kernels.

> > +_has_fs_sysfs_attr $SCRATCH_DEV zoned/nr_open_zones || \
> > +	_notrun "This test requires /sys/fs/${FSTYP}/$SCRATCH_DEV/zoned/nr_open_zones"
> 
> Can this be replaced with "_require_fs_sysfs_attr" ? _require_fs_sysfs_attr also can
> help to get the real path to the sysfs directory for the fs on a device.

No, this must happen on the scratch file system where we force the
zoned allocator, as the attribute only exists for those.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.