public inbox for fstests@vger.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>,
	Damien Le Moal <dlemoal@kernel.org>,
	Hans Holmberg <hans.holmberg@wdc.com>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted
Date: Thu, 18 Dec 2025 18:12:34 -0800	[thread overview]
Message-ID: <20251219021234.GB7725@frogsfrogsfrogs> (raw)
In-Reply-To: <20251218161045.1652741-2-hch@lst.de>

On Thu, Dec 18, 2025 at 05:10:16PM +0100, Christoph Hellwig wrote:
> Garbage collection assumes all zones contain the full amount of blocks.
> Mkfs already ensures this happens, but the kernel mount code did not
> verify this.  Instead such a file system would eventually fail scrub.
> 
> Add a test to verify the new superblock verifier check.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/651     | 33 +++++++++++++++++++++++++++++++++
>  tests/xfs/651.out |  2 ++
>  2 files changed, 35 insertions(+)
>  create mode 100755 tests/xfs/651
>  create mode 100644 tests/xfs/651.out
> 
> diff --git a/tests/xfs/651 b/tests/xfs/651
> new file mode 100755
> index 000000000000..1e36fec408ff
> --- /dev/null
> +++ b/tests/xfs/651
> @@ -0,0 +1,33 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Christoph Hellwig.
> +#
> +# FS QA Test No. 651
> +#
> +# Test that the sb verifier rejects zoned file system with rump RTGs.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick zone
> +
> +. ./common/zoned
> +
> +# we intentionally corrupt the superblock
> +_require_scratch_nocheck
> +
> +_try_scratch_mkfs_xfs -r zoned=1 >> $seqres.full 2>&1 || \
> +	_notrun "Can't create zoned file system"
> +
> +# adjust rblocks/rextents to not be zone aligned
> +blocks=$(_scratch_xfs_get_sb_field rblocks)
> +blocks=$((blocks - 4096))
> +_scratch_xfs_set_sb_field rblocks ${blocks} >> $seqres.full 2>&1
> +_scratch_xfs_set_sb_field rextents ${blocks} >> $seqres.full 2>&1
> +
> +if _try_scratch_mount >/dev/null 2>&1; then
> +	echo "Mounted rump RTG file system (bad)"
> +fi
> +
> +echo "Can't mount rump RTG file system (good)"

In theory this should be in an else clause, but as extra lines in the
golden output is enough to fail the test, this code flow is correct.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> +
> +status=0
> +exit
> diff --git a/tests/xfs/651.out b/tests/xfs/651.out
> new file mode 100644
> index 000000000000..5d491b1894ea
> --- /dev/null
> +++ b/tests/xfs/651.out
> @@ -0,0 +1,2 @@
> +QA output created by 651
> +Can't mount rump RTG file system (good)
> -- 
> 2.47.3
> 
> 

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

Thread overview: 12+ 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 [this message]
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
  -- 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 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted Christoph Hellwig
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

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=20251219021234.GB7725@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