From f4ec120ffd251564cc78d6d0dae78ca93cb5b648 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 19 Dec 2025 06:35:44 +0100 Subject: [PATCH] xfs: add a test that zoned file systems with rump RTG can't be mounted 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 Reviewed-by: Darrick J. Wong Signed-off-by: Zorro Lang --- tests/xfs/651 | 34 ++++++++++++++++++++++++++++++++++ tests/xfs/651.out | 2 ++ 2 files changed, 36 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 00000000..b2d34af3 --- /dev/null +++ b/tests/xfs/651 @@ -0,0 +1,34 @@ +#! /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)" +else + echo "Can't mount rump RTG file system (good)" +fi + + +status=0 +exit diff --git a/tests/xfs/651.out b/tests/xfs/651.out new file mode 100644 index 00000000..5d491b18 --- /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