All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Zorro Lang <zlang@kernel.org>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
Date: Mon, 15 Dec 2025 11:28:21 -0800	[thread overview]
Message-ID: <20251215192821.GL7725@frogsfrogsfrogs> (raw)
In-Reply-To: <20251215095036.537938-3-hch@lst.de>

On Mon, Dec 15, 2025 at 10:50:28AM +0100, Christoph Hellwig wrote:
> Check that a file system with a zoned RT subvolume can't be resized to
> a size not aligned to the zone size.
> 
> Uses a zloop device so that we can control the exact zone size.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

It seems to me that this test is creating a 10G zoned volume with a zone
size of 256M, and then growfs'ing to (12G + 52K) which is supposed to
fail, correct?

If so, then
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  tests/xfs/652     | 58 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/652.out |  4 ++++
>  2 files changed, 62 insertions(+)
>  create mode 100755 tests/xfs/652
>  create mode 100644 tests/xfs/652.out
> 
> diff --git a/tests/xfs/652 b/tests/xfs/652
> new file mode 100755
> index 000000000000..91399be28df0
> --- /dev/null
> +++ b/tests/xfs/652
> @@ -0,0 +1,58 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2025 Christoph Hellwig.
> +#
> +# FS QA Test No. 652
> +#
> +# Tests that xfs_growfs to a realtime volume size that is not zone aligned is
> +# rejected.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick realtime growfs zone
> +
> +. ./common/filter
> +. ./common/zoned
> +
> +_require_realtime
> +_require_zloop
> +_require_scratch
> +_require_scratch_size $((16 * 1024 * 1024)) # 16GiB in kiB units
> +
> +_cleanup()
> +{
> +	if [ -n "$mnt" ]; then
> +		_unmount $mnt 2>/dev/null
> +	fi
> +	_destroy_zloop $zloop
> +	cd /
> +	rm -r -f $tmp.*
> +}
> +
> +_scratch_mkfs > /dev/null 2>&1
> +_scratch_mount
> +
> +fsbsize=4096
> +unaligned_size=$((((12 * 1024 * 1024 * 1024) + (fsbsize * 13)) / fsbsize))
> +
> +mnt="$SCRATCH_MNT/mnt"
> +zloopdir="$SCRATCH_MNT/zloop"
> +
> +mkdir -p $mnt
> +zloop=$(_create_zloop $zloopdir 256 2)
> +
> +echo "Format and mount zloop file system"
> +_try_mkfs_dev -b size=4k -r size=10g $zloop >> $seqres.full 2>&1 ||\
> +	_notrun "cannot mkfs zoned filesystem"
> +_mount $zloop $mnt
> +
> +echo "Try to grow file system to a not zone aligned size"
> +$XFS_GROWFS_PROG -R $unaligned_size $mnt >> $seqres.full 2>&1 && \
> +	_fail "growfs to unaligned size succeeded"
> +
> +echo "Remount file system"
> +umount $mnt
> +_mount $zloop $mnt
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/652.out b/tests/xfs/652.out
> new file mode 100644
> index 000000000000..8de9ab41d47f
> --- /dev/null
> +++ b/tests/xfs/652.out
> @@ -0,0 +1,4 @@
> +QA output created by 652
> +Format and mount zloop file system
> +Try to grow file system to a not zone aligned size
> +Remount file system
> -- 
> 2.47.3
> 
> 

  reply	other threads:[~2025-12-15 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15  9:50 various tests for zone aligned RT subvolumes Christoph Hellwig
2025-12-15  9:50 ` [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted Christoph Hellwig
2025-12-15 19:33   ` Darrick J. Wong
2025-12-16  5:12     ` Christoph Hellwig
2025-12-16 19:05       ` Darrick J. Wong
2025-12-15  9:50 ` [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails Christoph Hellwig
2025-12-15 19:28   ` Darrick J. Wong [this message]
2025-12-16  5:12     ` Christoph Hellwig
2025-12-15  9:50 ` [PATCH 3/3] xfs: add a test that mkfs round up realtime subvolume sizes to the zone size Christoph Hellwig
2025-12-15 19:25   ` Darrick J. Wong
2025-12-16  5:13     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2025-12-18 16:10 various tests for zone aligned RT subvolumes v2 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-19  5:35 various tests for zone aligned RT subvolumes v3 Christoph Hellwig
2025-12-19  5:35 ` [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails 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=20251215192821.GL7725@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.