* various tests for zone aligned RT subvolumes
@ 2025-12-15 9:50 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
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-15 9:50 UTC (permalink / raw)
To: Zorro Lang; +Cc: Darrick J. Wong, fstests, linux-xfs
Hi all,
this adds a few tests to make sure zoned RT subvolumes are always aligned
to the zone size.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted
2025-12-15 9:50 various tests for zone aligned RT subvolumes Christoph Hellwig
@ 2025-12-15 9:50 ` Christoph Hellwig
2025-12-15 19:33 ` 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 9:50 ` [PATCH 3/3] xfs: add a test that mkfs round up realtime subvolume sizes to the zone size Christoph Hellwig
2 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-15 9:50 UTC (permalink / raw)
To: Zorro Lang; +Cc: Darrick J. Wong, fstests, linux-xfs
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 | 30 ++++++++++++++++++++++++++++++
tests/xfs/651.out | 2 ++
2 files changed, 32 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..1fa9627098f6
--- /dev/null
+++ b/tests/xfs/651
@@ -0,0 +1,30 @@
+#! /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
+
+_require_scratch_nocheck
+
+_scratch_mkfs > /dev/null 2>&1
+blocks=$(_scratch_xfs_db -c 'sb 0' -c 'print rblocks' | awk '{print $3}')
+blocks=$((blocks - 4096))
+_scratch_xfs_db -x -c 'sb 0' -c "write -d rblocks $blocks" > /dev/null 2>&1
+_scratch_xfs_db -x -c 'sb 0' -c "write -d rextents $blocks" > /dev/null 2>&1
+
+if _try_scratch_mount >/dev/null 2>&1; then
+ # for non-zoned file systems this can succeed just fine
+ _require_xfs_scratch_non_zoned
+fi
+
+echo "Can't mount rump RTG file system (good)"
+
+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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
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 9:50 ` Christoph Hellwig
2025-12-15 19:28 ` Darrick J. Wong
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
2 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-15 9:50 UTC (permalink / raw)
To: Zorro Lang; +Cc: Darrick J. Wong, fstests, linux-xfs
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>
---
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 3/3] xfs: add a test that mkfs round up realtime subvolume sizes to the zone size
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 9:50 ` [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails Christoph Hellwig
@ 2025-12-15 9:50 ` Christoph Hellwig
2025-12-15 19:25 ` Darrick J. Wong
2 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-15 9:50 UTC (permalink / raw)
To: Zorro Lang; +Cc: Darrick J. Wong, fstests, linux-xfs
Make sure mkfs doesn't create unmountable file systems.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
tests/xfs/653 | 33 +++++++++++++++++++++++++++++++++
tests/xfs/653.out | 2 ++
2 files changed, 35 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..07d9125c2ff0
--- /dev/null
+++ b/tests/xfs/653
@@ -0,0 +1,33 @@
+#! /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
+
+_require_realtime
+_require_scratch
+_require_scratch_size $((2 * 1024 * 1024)) # 1GiB in kiB units
+
+fsbsize=4096
+unaligned_size=$((((1 * 1024 * 1024 * 1024) + (fsbsize * 13)) / fsbsize))
+
+# Manual mkfs and mount to not inject an existing RT device
+echo "Try to format file system"
+_try_mkfs_dev -b size=4k -r zoned=1,size=${unaligned_size}b $SCRATCH_DEV \
+ >> $seqres.full 2>&1 ||\
+ _notrun "cannot mkfs zoned filesystem"
+_mount $SCRATCH_DEV $SCRATCH_MNT
+umount $SCRATCH_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..2cba5cdf1171
--- /dev/null
+++ b/tests/xfs/653.out
@@ -0,0 +1,2 @@
+QA output created by 653
+Try to format file system
--
2.47.3
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] xfs: add a test that mkfs round up realtime subvolume sizes to the zone size
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
0 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2025-12-15 19:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Zorro Lang, fstests, linux-xfs
On Mon, Dec 15, 2025 at 10:50:29AM +0100, Christoph Hellwig wrote:
> Make sure mkfs doesn't create unmountable file systems.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> tests/xfs/653 | 33 +++++++++++++++++++++++++++++++++
> tests/xfs/653.out | 2 ++
> 2 files changed, 35 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..07d9125c2ff0
> --- /dev/null
> +++ b/tests/xfs/653
> @@ -0,0 +1,33 @@
> +#! /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.
What size rt volume does this create? It looks like you're specifying
an rt zone size of ... (1GB + 52K)? And testing that mkfs rounds the
rt volume size down to some multiple of that? Or is it rounding the
*zone* size down to 1G?
<confused>
--D
> +. ./common/preamble
> +_begin_fstest auto quick realtime growfs zone
> +
> +. ./common/filter
> +. ./common/zoned
> +
> +_require_realtime
> +_require_scratch
> +_require_scratch_size $((2 * 1024 * 1024)) # 1GiB in kiB units
> +
> +fsbsize=4096
> +unaligned_size=$((((1 * 1024 * 1024 * 1024) + (fsbsize * 13)) / fsbsize))
> +
> +# Manual mkfs and mount to not inject an existing RT device
> +echo "Try to format file system"
> +_try_mkfs_dev -b size=4k -r zoned=1,size=${unaligned_size}b $SCRATCH_DEV \
> + >> $seqres.full 2>&1 ||\
> + _notrun "cannot mkfs zoned filesystem"
> +_mount $SCRATCH_DEV $SCRATCH_MNT
> +umount $SCRATCH_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..2cba5cdf1171
> --- /dev/null
> +++ b/tests/xfs/653.out
> @@ -0,0 +1,2 @@
> +QA output created by 653
> +Try to format file system
> --
> 2.47.3
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
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
2025-12-16 5:12 ` Christoph Hellwig
0 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2025-12-15 19:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Zorro Lang, fstests, linux-xfs
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
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted
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
0 siblings, 1 reply; 13+ messages in thread
From: Darrick J. Wong @ 2025-12-15 19:33 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Zorro Lang, fstests, linux-xfs
On Mon, Dec 15, 2025 at 10:50:27AM +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 | 30 ++++++++++++++++++++++++++++++
> tests/xfs/651.out | 2 ++
> 2 files changed, 32 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..1fa9627098f6
> --- /dev/null
> +++ b/tests/xfs/651
> @@ -0,0 +1,30 @@
> +#! /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
> +
> +_require_scratch_nocheck
> +
> +_scratch_mkfs > /dev/null 2>&1
> +blocks=$(_scratch_xfs_db -c 'sb 0' -c 'print rblocks' | awk '{print $3}')
> +blocks=$((blocks - 4096))
> +_scratch_xfs_db -x -c 'sb 0' -c "write -d rblocks $blocks" > /dev/null 2>&1
> +_scratch_xfs_db -x -c 'sb 0' -c "write -d rextents $blocks" > /dev/null 2>&1
You could put both of the write commands in the same invocation, e.g.
_scratch_xfs_db -x \
-c 'sb 0' \
-c "write -d rblocks $blocks" \
-c "write -d rextents $blocks" > /dev/null 2>&1
For a little bit lower runtime.
> +
> +if _try_scratch_mount >/dev/null 2>&1; then
> + # for non-zoned file systems this can succeed just fine
> + _require_xfs_scratch_non_zoned
The logic in this test looks fine to me, but I wonder: have you (or
anyone else) gone to Debian 13 and noticed this:
# mount /dev/sda /mnt
# mount /dev/sda /mnt
# grep /mnt /proc/mounts
/dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
/dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
It looks like util-linux switched to the new fsopen mount API between
Debian 12 and 13, and whereas the old mount(8) would fail if the fs was
already mounted, the new one just creates two mounts, which both then
must be unmounted. So now I'm hunting around for unbalanced
mount/unmount pairs in fstests. :(
Anyhow the test looks fine, so
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> +fi
> +
> +echo "Can't mount rump RTG file system (good)"
> +
> +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
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted
2025-12-15 19:33 ` Darrick J. Wong
@ 2025-12-16 5:12 ` Christoph Hellwig
2025-12-16 19:05 ` Darrick J. Wong
0 siblings, 1 reply; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-16 5:12 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Christoph Hellwig, Zorro Lang, fstests, linux-xfs
On Mon, Dec 15, 2025 at 11:33:45AM -0800, Darrick J. Wong wrote:
> > +_scratch_mkfs > /dev/null 2>&1
> > +blocks=$(_scratch_xfs_db -c 'sb 0' -c 'print rblocks' | awk '{print $3}')
> > +blocks=$((blocks - 4096))
> > +_scratch_xfs_db -x -c 'sb 0' -c "write -d rblocks $blocks" > /dev/null 2>&1
> > +_scratch_xfs_db -x -c 'sb 0' -c "write -d rextents $blocks" > /dev/null 2>&1
>
> You could put both of the write commands in the same invocation, e.g.
>
> _scratch_xfs_db -x \
> -c 'sb 0' \
> -c "write -d rblocks $blocks" \
> -c "write -d rextents $blocks" > /dev/null 2>&1
>
> For a little bit lower runtime.
I can do that, but I doubt it really matters..
> > +if _try_scratch_mount >/dev/null 2>&1; then
> > + # for non-zoned file systems this can succeed just fine
> > + _require_xfs_scratch_non_zoned
>
> The logic in this test looks fine to me, but I wonder: have you (or
> anyone else) gone to Debian 13 and noticed this:
>
> # mount /dev/sda /mnt
> # mount /dev/sda /mnt
> # grep /mnt /proc/mounts
> /dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
> /dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
>
> It looks like util-linux switched to the new fsopen mount API between
> Debian 12 and 13, and whereas the old mount(8) would fail if the fs was
> already mounted, the new one just creates two mounts, which both then
> must be unmounted. So now I'm hunting around for unbalanced
> mount/unmount pairs in fstests. :(
The old mount API also supported that at the syscall level, but it got
disable in mount(8), so if mount now does this and previously didn't it
seems like an unintended change.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
2025-12-15 19:28 ` Darrick J. Wong
@ 2025-12-16 5:12 ` Christoph Hellwig
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-16 5:12 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Christoph Hellwig, Zorro Lang, fstests, linux-xfs
On Mon, Dec 15, 2025 at 11:28:21AM -0800, Darrick J. Wong wrote:
> 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?
Yes. Any way to make this more clear?
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 3/3] xfs: add a test that mkfs round up realtime subvolume sizes to the zone size
2025-12-15 19:25 ` Darrick J. Wong
@ 2025-12-16 5:13 ` Christoph Hellwig
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-16 5:13 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Christoph Hellwig, Zorro Lang, fstests, linux-xfs
On Mon, Dec 15, 2025 at 11:25:52AM -0800, Darrick J. Wong wrote:
> > +# the zone size to create mountable file systems.
>
> What size rt volume does this create? It looks like you're specifying
> an rt zone size of ... (1GB + 52K)?
Yes.
> And testing that mkfs rounds the
> rt volume size down to some multiple of that? Or is it rounding the
> *zone* size down to 1G?
That's it is rounding the RT device sizse down to a multiple of the
zone size, for which we default to 256MiB if not specified.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/3] xfs: add a test that zoned file systems with rump RTG can't be mounted
2025-12-16 5:12 ` Christoph Hellwig
@ 2025-12-16 19:05 ` Darrick J. Wong
0 siblings, 0 replies; 13+ messages in thread
From: Darrick J. Wong @ 2025-12-16 19:05 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Zorro Lang, fstests, linux-xfs
On Tue, Dec 16, 2025 at 06:12:05AM +0100, Christoph Hellwig wrote:
> On Mon, Dec 15, 2025 at 11:33:45AM -0800, Darrick J. Wong wrote:
> > > +_scratch_mkfs > /dev/null 2>&1
> > > +blocks=$(_scratch_xfs_db -c 'sb 0' -c 'print rblocks' | awk '{print $3}')
> > > +blocks=$((blocks - 4096))
> > > +_scratch_xfs_db -x -c 'sb 0' -c "write -d rblocks $blocks" > /dev/null 2>&1
> > > +_scratch_xfs_db -x -c 'sb 0' -c "write -d rextents $blocks" > /dev/null 2>&1
> >
> > You could put both of the write commands in the same invocation, e.g.
> >
> > _scratch_xfs_db -x \
> > -c 'sb 0' \
> > -c "write -d rblocks $blocks" \
> > -c "write -d rextents $blocks" > /dev/null 2>&1
> >
> > For a little bit lower runtime.
>
> I can do that, but I doubt it really matters..
>
> > > +if _try_scratch_mount >/dev/null 2>&1; then
> > > + # for non-zoned file systems this can succeed just fine
> > > + _require_xfs_scratch_non_zoned
> >
> > The logic in this test looks fine to me, but I wonder: have you (or
> > anyone else) gone to Debian 13 and noticed this:
> >
> > # mount /dev/sda /mnt
> > # mount /dev/sda /mnt
> > # grep /mnt /proc/mounts
> > /dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
> > /dev/sda /mnt xfs rw,relatime,inode64,logbufs=8,logbsize=32k,noquota 0 0
> >
> > It looks like util-linux switched to the new fsopen mount API between
> > Debian 12 and 13, and whereas the old mount(8) would fail if the fs was
> > already mounted, the new one just creates two mounts, which both then
> > must be unmounted. So now I'm hunting around for unbalanced
> > mount/unmount pairs in fstests. :(
>
> The old mount API also supported that at the syscall level, but it got
> disable in mount(8), so if mount now does this and previously didn't it
> seems like an unintended change.
Oh, it's very much an intentional change. Someone complained and the
maintainer declined to revert:
https://github.com/util-linux/util-linux/issues/3800
because we can all just add --onlyonce to our scripts if we want the old
behavior. Or set LIBMOUNT_FORCE_MOUNT2=always and hope that doesn't go
away.
--D
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
2025-12-18 16:10 various tests for zone aligned RT subvolumes v2 Christoph Hellwig
@ 2025-12-18 16:10 ` Christoph Hellwig
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-18 16:10 UTC (permalink / raw)
To: Zorro Lang
Cc: Darrick J. Wong, Damien Le Moal, Hans Holmberg, fstests,
linux-xfs
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>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
---
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/3] xfs: test that RT growfs not aligned to zone size fails
2025-12-19 5:35 various tests for zone aligned RT subvolumes v3 Christoph Hellwig
@ 2025-12-19 5:35 ` Christoph Hellwig
0 siblings, 0 replies; 13+ messages in thread
From: Christoph Hellwig @ 2025-12-19 5:35 UTC (permalink / raw)
To: Zorro Lang
Cc: Darrick J. Wong, Damien Le Moal, Hans Holmberg, fstests,
linux-xfs
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>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
---
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2025-12-19 5:36 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox