From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Zorro Lang <zlang@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
Hans Holmberg <hans.holmberg@wdc.com>,
fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 3/3] xfs: test that mkfs creates zone-aligned RT devices
Date: Thu, 18 Dec 2025 18:14:04 -0800 [thread overview]
Message-ID: <20251219021404.GC7725@frogsfrogsfrogs> (raw)
In-Reply-To: <20251218161045.1652741-4-hch@lst.de>
On Thu, Dec 18, 2025 at 05:10:18PM +0100, Christoph Hellwig wrote:
> Make sure mkfs doesn't create unmountable file systems and instead rounds
> down the RT subvolume size to a multiple of the zone size.
>
> Two passes: one with a device that is not aligned, and one for an
> explicitly specified unaligned RT device size.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks good to me,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> tests/xfs/653 | 66 +++++++++++++++++++++++++++++++++++++++++++++++
> tests/xfs/653.out | 3 +++
> 2 files changed, 69 insertions(+)
> create mode 100755 tests/xfs/653
> create mode 100644 tests/xfs/653.out
>
> diff --git a/tests/xfs/653 b/tests/xfs/653
> new file mode 100755
> index 000000000000..12d606c436f0
> --- /dev/null
> +++ b/tests/xfs/653
> @@ -0,0 +1,66 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2025 Christoph Hellwig.
> +#
> +# FS QA Test No. 653
> +#
> +# Tests that mkfs for a zoned file system rounds realtime subvolume sizes up to
> +# the zone size to create mountable file systems.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick realtime growfs zone
> +
> +. ./common/filter
> +. ./common/zoned
> +
> +_cleanup()
> +{
> + _unmount $LOOP_MNT 2>/dev/null
> + [ -n "$loop_dev" ] && _destroy_loop_device $loop_dev
> + rm -rf $LOOP_IMG $LOOP_MNT
> + cd /
> + rm -f $tmp.*
> +}
> +
> +_require_test
> +_require_loop
> +_require_xfs_io_command "truncate"
> +
> +fsbsize=4096
> +aligned_size=$((3 * 1024 * 1024 * 1024))
> +unaligned_size=$((2 * 1024 * 1024 * 1024 + fsbsize * 13))
> +
> +_require_fs_space $TEST_DIR $((aligned_size / 1024))
> +
> +LOOP_IMG=$TEST_DIR/$seq.dev
> +LOOP_MNT=$TEST_DIR/$seq.mnt
> +rm -rf $LOOP_IMG $LOOP_MNT
> +mkdir -p $LOOP_MNT
> +
> +# try to create an unaligned RT volume by manually specifying the RT device size
> +$XFS_IO_PROG -f -c "truncate ${aligned_size}" $LOOP_IMG
> +loop_dev=$(_create_loop_device $LOOP_IMG)
> +
> +echo "Formatting file system (unaligned specified size)"
> +_try_mkfs_dev -b size=4k -r zoned=1,size=$((unaligned_size / fsbsize))b $loop_dev \
> + >> $seqres.full 2>&1 ||\
> + _notrun "cannot mkfs zoned filesystem"
> +_mount $loop_dev $LOOP_MNT
> +umount $LOOP_MNT
> +_destroy_loop_device $loop_dev
> +rm -rf $LOOP_IMG
> +
> +# try to create an unaligned RT volume on on an oddly sized device
> +$XFS_IO_PROG -f -c "truncate ${unaligned_size}" $LOOP_IMG
> +loop_dev=$(_create_loop_device $LOOP_IMG)
> +
> +echo "Formatting file system (unaligned device)"
> +_try_mkfs_dev -b size=4k -r zoned=1 $loop_dev \
> + >> $seqres.full 2>&1 ||\
> + _notrun "cannot mkfs zoned filesystem"
> +_mount $loop_dev $LOOP_MNT
> +umount $LOOP_MNT
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/653.out b/tests/xfs/653.out
> new file mode 100644
> index 000000000000..96158d93f55c
> --- /dev/null
> +++ b/tests/xfs/653.out
> @@ -0,0 +1,3 @@
> +QA output created by 653
> +Formatting file system (unaligned specified size)
> +Formatting file system (unaligned device)
> --
> 2.47.3
>
>
next prev parent reply other threads:[~2025-12-19 2:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 16:10 various tests for zone aligned RT subvolumes v2 Christoph Hellwig
2025-12-18 16:10 ` [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted Christoph Hellwig
2025-12-19 2:12 ` Darrick J. Wong
2025-12-19 5:26 ` Christoph Hellwig
2025-12-18 16:10 ` [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails Christoph Hellwig
2025-12-18 16:10 ` [PATCH 3/3] xfs: test that mkfs creates zone-aligned RT devices Christoph Hellwig
2025-12-19 2:14 ` Darrick J. Wong [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-12-19 5:35 various tests for zone aligned RT subvolumes v3 Christoph Hellwig
2025-12-19 5:35 ` [PATCH 3/3] xfs: test that mkfs creates zone-aligned RT devices Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219021404.GC7725@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=dlemoal@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox