Skip to contentSkip to conversation

initial xfstests support for zoned XFS v2

PATCH In review Christoph Hellwig 2 participants 19 messages Mar 21, 2025

lore
Share & tools
lore
#0 lore raw

Hi all,

this series adds initial support for the zoned XFS code merge into the xfs tree to xfstests. It does not include several newly developed test cases which will be sent separately.

Changes since v1:
- improve a few commit messages
- use -n instead -b in _require_dm_target
- add a code comment
- use $XFS_INFO_PROG instead of xfs_info
- fix spelling in a code comment
- don't re-specify the zoned option in _scratch_xfs_force_no_metadir
- don't skip xfs/311 on zoned devices. A patch to support zoned devices in dm-delay has been sent to the device mapper list instead
- remove the _notrun due to non-aligned dm maps in xfs/438 as this test is already skipped due to the lack of quota support
- drop the patches that parse mkfs output for now. They will be added once the output has been improved, finalized and merged in xfsprogs.

#1 lore raw

PATCH 1/13 xfs/177: force a small file system size

This test make assumptions about the number of metadata inodes. When using small realtime group size (e.g. the customary 256MB for SMR hard drives) this assumption gets violated even with modest file system size. Force a small file system size to side-step this issue.

---
 tests/xfs/177 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/xfs/177 +3 -1
index 82b3ca264140..8d23f66d51b7 100755
@@ -77,7 +77,9 @@ delay_centisecs="$(cat "$xfs_centisecs_file")"
 sleep_seconds=$(( ( (99 + (delay_centisecs / 6) ) / 100) + 1))
 echo "Will sleep $sleep_seconds seconds to expire inodes" >> $seqres.full
 
-_scratch_mkfs >> $seqres.full
+# Force a relatively small file system size to keep the number of rtgroups
+# and thus metadata inodes low
+_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full
 _scratch_mount >> $seqres.full
 
 junkdir=$SCRATCH_MNT/$seq.junk
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/13 xfs/419: use _scratch_mkfs_xfs

In reply to Christoph Hellwig

So that the test is _notrun instead of failed for conflicting options like -r zoned or specific RT group configurations.

---
 tests/xfs/419 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/419 +1 -1
index b9cd21faf443..5e122a0b8763 100755
@@ -39,7 +39,7 @@ $MKFS_XFS_PROG -d rtinherit=0 "${mkfs_args[@]}" &>> $seqres.full || \
 	echo "mkfs should succeed with uninheritable rtext-unaligned extent hint"
 
 # Move on to checking the kernel's behavior
-_scratch_mkfs -r extsize=7b | _filter_mkfs >> $seqres.full 2> $tmp.mkfs
+_scratch_mkfs_xfs -r extsize=7b | _filter_mkfs >> $seqres.full 2> $tmp.mkfs
 cat $tmp.mkfs >> $seqres.full
 . $tmp.mkfs
 _scratch_mount
Signature · 1 line
2.45.2
#3 lore raw

PATCH 3/13 xfs/540: use _scratch_mkfs_xfs

In reply to Christoph Hellwig

So that the test is _notrun instead of failed for conflicting options like -r zoned or specific RT group configurations.

---
 tests/xfs/540 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/540 +1 -1
index 3acb20951a56..9c0fa3c6bb10 100755
@@ -26,7 +26,7 @@ _begin_fstest auto repair fuzzers
 _require_scratch
 
 echo "Format and mount"
-_scratch_mkfs -r extsize=7b | _filter_mkfs > $seqres.full 2>$tmp.mkfs
+_scratch_mkfs_xfs -r extsize=7b | _filter_mkfs > $seqres.full 2>$tmp.mkfs
 cat $tmp.mkfs >> $seqres.full
 . $tmp.mkfs
 
Signature · 1 line
2.45.2
#4 lore raw

PATCH 4/13 common: extend the zoned device checks in _require_dm_target

In reply to Christoph Hellwig

Also check for zoned log and rt devices in _require_dm_target

---
 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)
common/rc +6 -0
index e51686389a78..7cd8d5ffd2e8 100644
@@ -2501,6 +2501,12 @@ _require_dm_target()
 	case $target in
 	snapshot|thin-pool)
 		_require_non_zoned_device ${SCRATCH_DEV}
+	        if [ "$FSTYP" = "xfs" ] && [ -n "$SCRATCH_RTDEV" ]; then
+			_require_non_zoned_device ${SCRATCH_RTDEV}
+		fi
+	        if [ "$FSTYP" = "xfs" ] && [ -n "$SCRATCH_LOGDEV" ]; then
+			_require_non_zoned_device ${SCRATCH_LOGDEV}
+		fi
 		;;
 	esac
 }
Signature · 1 line
2.45.2
#5 lore raw

PATCH 5/13 common: allow _require_non_zoned_device without an argument

In reply to Christoph Hellwig

So that callers can pass $SCRATCH_RTDEV directly without needing to check that it actually is set.

---
 common/rc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
common/rc +1 -2
index 7cd8d5ffd2e8..dc6d4ce01e05 100644
@@ -2545,8 +2545,7 @@ _require_non_zoned_device()
 {
 	local target=$1
 	if [ -z $target ]; then
-		echo "Usage: _require_non_zoned_device <device>"
-		exit 1
+		return
 	fi
 
 	local type=`_zone_type ${target}`
Signature · 1 line
2.45.2
Reviewed-by on v1 5/13
#6 lore raw

Re: [PATCH 05/13] common: allow _require_non_zoned_device without an argument

Quoted 4 lines · Christoph Hellwig

So that callers can pass $SCRATCH_RTDEV directly without needing to check that it actually is set.

Looks good,

--D

Quoted 22 lines
---
 common/rc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
common/rc +1 -2
index 7cd8d5ffd2e8..dc6d4ce01e05 100644
@@ -2545,8 +2545,7 @@ _require_non_zoned_device()
 {
 	local target=$1
 	if [ -z $target ]; then
-		echo "Usage: _require_non_zoned_device <device>"
-		exit 1
+		return
 	fi
 
 	local type=`_zone_type ${target}`
Signature · 1 line
2.45.2
#7 lore raw

PATCH 6/13 xfs: add helpers to require zoned/non-zoned file systems

In reply to Christoph Hellwig

Looking at the max_open_zones sysfs attribute to see if a file system is zoned or not, as various tests depend on that.

---
 common/xfs | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
common/xfs +27 -0
index 93260fdb4599..3663e4cf03bd 100644
@@ -2071,6 +2071,33 @@ _scratch_xfs_force_no_metadir()
 	fi
 }
 
+# do not run on zoned file systems
+_require_xfs_scratch_non_zoned()
+{
+	if _has_fs_sysfs_attr $SCRATCH_DEV "zoned/max_open_zones"; then
+		_notrun "Not supported on zoned file systems"
+	fi
+}
+
+# only run on zoned file systems
+_require_xfs_scratch_zoned()
+{
+	local attr="zoned/max_open_zones"
+	local min_open_zones=$1
+
+	if ! _has_fs_sysfs_attr $SCRATCH_DEV $attr; then
+		_notrun "Requires zoned file system"
+	fi
+
+	if [ -n "${min_open_zones}" ]; then
+		local has_open_zones=`_get_fs_sysfs_attr $SCRATCH_DEV $attr`
+
+		if [ "${min_open_zones}" -gt "${has_open_zones}" ]; then
+			_notrun "Requires at least ${min_open_zones} open zones"
+		fi
+	fi
+}
+
 # Decide if a mount filesystem has metadata directory trees.
 _xfs_mount_has_metadir() {
 	local mount="$1"
Signature · 1 line
2.45.2
#8 lore raw

PATCH 7/13 xfs: handle zoned file systems in _scratch_xfs_force_no_metadir

In reply to Christoph Hellwig

Zoned file systems required the metadir feature. If the tests are run on a conventional block device as the RT device, we can simply remove the zoned flag an run the test, but if the file systems sits on a zoned block device there is no way to run a test that wants a non-metadir file system.

---
 common/xfs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/xfs +12 -0
index 3663e4cf03bd..c1b4c5577b2b 100644
@@ -2049,6 +2049,12 @@ _scratch_xfs_find_metafile()
 # Force metadata directories off.
 _scratch_xfs_force_no_metadir()
 {
+	_require_non_zoned_device $SCRATCH_DEV
+	# metadir is required for when the rt device is on a zoned device
+	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
+		_require_non_zoned_device $SCRATCH_RTDEV
+	fi
+
 	# Remove any mkfs-time quota options because those are only supported
 	# with metadir=1
 	for opt in uquota gquota pquota; do
@@ -2068,6 +2074,12 @@ _scratch_xfs_force_no_metadir()
 	# that option.
 	if grep -q 'metadir=' $MKFS_XFS_PROG; then
 		MKFS_OPTIONS="-m metadir=0 $MKFS_OPTIONS"
+	fi	
+
+	# Replace any explicit zonedr option with zoned=0
+	if echo "$MKFS_OPTIONS" | grep -q 'zoned='; then
+		MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/zoned=[0-9]*/zoned=0/g' -e 's/zoned\([, ]\)/zoned=0\1/g')"
+		return
 	fi
 }
 
Signature · 1 line
2.45.2
Reviewed-by on v1 7/13
#9 lore raw

Re: [PATCH 07/13] xfs: handle zoned file systems in _scratch_xfs_force_no_metadir

Quoted 29 lines · Christoph Hellwig

Zoned file systems required the metadir feature. If the tests are run on a conventional block device as the RT device, we can simply remove the zoned flag an run the test, but if the file systems sits on a zoned block device there is no way to run a test that wants a non-metadir file system.

---
 common/xfs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/xfs +6 -0
index 3663e4cf03bd..c1b4c5577b2b 100644
@@ -2049,6 +2049,12 @@ _scratch_xfs_find_metafile()
 # Force metadata directories off.
 _scratch_xfs_force_no_metadir()
 {
+	_require_non_zoned_device $SCRATCH_DEV
+	# metadir is required for when the rt device is on a zoned device
+	if [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ]; then
+		_require_non_zoned_device $SCRATCH_RTDEV
+	fi
+
 	# Remove any mkfs-time quota options because those are only supported
 	# with metadir=1
 	for opt in uquota gquota pquota; do

common/xfs _scratch_xfs_force_no_metadir() · line 2077

Quoted 4 lines
common/xfs +1 -0
@@ -2068,6 +2074,12 @@ _scratch_xfs_force_no_metadir()
 	# that option.
 	if grep -q 'metadir=' $MKFS_XFS_PROG; then
 		MKFS_OPTIONS="-m metadir=0 $MKFS_OPTIONS"
+	fi	

Dumb nit: ^^^^^^ extra space here

common/xfs _scratch_xfs_force_no_metadir() · line 2081

Quoted 4 lines
common/xfs +4 -0
+
+	# Replace any explicit zonedr option with zoned=0
+	if echo "$MKFS_OPTIONS" | grep -q 'zoned='; then
+		MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/zoned=[0-9]*/zoned=0/g' -e 's/zoned\([, ]\)/zoned=0\1/g')"

With that fixed,

--D

Quoted 8 lines
common/xfs +1 -0
+		return
 	fi
 }
 
Signature · 1 line
2.45.2
#10 lore raw

PATCH 8/13 xfs: no quota support with internal rtdev

In reply to Christoph Hellwig

Same as regular zoned, but the previous check didn't work.

---
 common/xfs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
common/xfs +4 -1
index c1b4c5577b2b..ccf263aeb969 100644
@@ -2206,7 +2206,10 @@ _xfs_scratch_supports_rtquota() {
 # can check that quickly, and we make the bold assumption that the same will
 # apply to any scratch fs that might be created.
 _require_xfs_rtquota_if_rtdev() {
-	test "$USE_EXTERNAL" = "yes" || return
+	if [ "$USE_EXTERNAL" != "yes" ]; then
+		$XFS_INFO_PROG "$TEST_DIR" | grep -q 'realtime.*internal' &&
+			_notrun "Quota on internal rt device not supported"
+	fi
 
 	if [ -n "$TEST_RTDEV$SCRATCH_RTDEV" ]; then
 		_xfs_kmod_supports_rtquota || \
Signature · 1 line
2.45.2
#11 lore raw

PATCH 9/13 xfs: xfs_copy doesn't like RT sections

In reply to Christoph Hellwig

internal or external..

---
 common/xfs | 3 +++
 1 file changed, 3 insertions(+)
common/xfs +3 -0
index ccf263aeb969..d9999829d3b5 100644
@@ -1556,6 +1556,9 @@ _require_xfs_copy()
 	[ "$USE_EXTERNAL" = yes ] && \
 		_notrun "Cannot xfs_copy with external devices"
 
+	$XFS_INFO_PROG "$TEST_DIR" | grep -q 'realtime.*internal' &&
+		_notrun "Cannot xfs_copy with internal rt device"
+
 	# xfs_copy on v5 filesystems do not require the "-d" option if xfs_db
 	# can change the UUID on v5 filesystems
 	touch /tmp/$$.img
Signature · 1 line
2.45.2
Reviewed-by on v1 9/13
#12 lore raw

Re: [PATCH 09/13] xfs: xfs_copy doesn't like RT sections

Quoted 3 lines · Christoph Hellwig

internal or external..

Some day someone ought to make xfs_copy work on rt volumes...

--D

Quoted 22 lines
---
 common/xfs | 3 +++
 1 file changed, 3 insertions(+)
common/xfs +3 -0
index ccf263aeb969..d9999829d3b5 100644
@@ -1556,6 +1556,9 @@ _require_xfs_copy()
 	[ "$USE_EXTERNAL" = yes ] && \
 		_notrun "Cannot xfs_copy with external devices"
 
+	$XFS_INFO_PROG "$TEST_DIR" | grep -q 'realtime.*internal' &&
+		_notrun "Cannot xfs_copy with internal rt device"
+
 	# xfs_copy on v5 filesystems do not require the "-d" option if xfs_db
 	# can change the UUID on v5 filesystems
 	touch /tmp/$$.img
Signature · 1 line
2.45.2
#13 lore raw

PATCH 10/13 xfs: skip filestreams tests on internal RT devices

In reply to Christoph Hellwig

The filestreams tests using _test_streams force a run on the data section, but for internal RT zoned devices the data section can be tiny and might not provide enough space. Skip these tests as they aren't really useful when testing a zoned config anyway.

---
 common/filestreams | 5 +++++
 1 file changed, 5 insertions(+)
common/filestreams +5 -0
index 00b28066873f..bb8459405b3e 100644
@@ -108,6 +108,11 @@ _test_streams() {
 		_scratch_mount
 	fi
 
+	# Skip these tests on zoned file systems as filestreams don't work
+	# with the zoned allocator, and the above would force it into the
+	# tiny data section only used for metadata anyway.
+	_require_xfs_scratch_non_zoned
+
 	cd $SCRATCH_MNT
 
 	# start $stream_count streams
Signature · 1 line
2.45.2
#14 lore raw

PATCH 11/13 xfs: skip various tests when using the zoned allocator

In reply to Christoph Hellwig

Various file system features tested are incompatible with the zoned allocator. Add a _require_xfs_scratch_non_zoned to guard them.

---
 tests/xfs/015 |  7 +++++++
 tests/xfs/041 |  5 +++++
 tests/xfs/272 |  5 +++++
 tests/xfs/276 |  5 +++++
 tests/xfs/306 |  4 ++++
 tests/xfs/419 |  3 +++
 tests/xfs/449 |  3 +++
 tests/xfs/521 |  3 +++
 tests/xfs/524 |  4 ++++
 tests/xfs/540 |  3 +++
 tests/xfs/541 |  3 +++
 tests/xfs/556 | 13 +++++++++++++
 tests/xfs/596 |  3 +++
 13 files changed, 61 insertions(+)
tests/xfs/015 +7 -0
index acaace0ce103..ddb3e0911813 100755
@@ -38,6 +38,13 @@ _require_scratch
 # need 128M space, don't make any assumption
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
+
+# This test tries to grow the data device, which doesn't work for internal
+# zoned RT devices
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 _require_fs_space $SCRATCH_MNT 196608
 _scratch_unmount
 
tests/xfs/041 +5 -0
index 780078d44eeb..6cbcef6cfff0 100755
@@ -44,6 +44,11 @@ bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
 onemeginblocks=`expr 1048576 / $bsize`
 _scratch_mount
 
+# Growing the data device doesn't work with an internal RT volume directly
+# following the data device.  But even without that this test forces data
+# to the data device, which often is tiny on zoned file systems.
+_require_xfs_scratch_non_zoned
+
 # We're growing the data device, so force new file creation there
 _xfs_force_bdev data $SCRATCH_MNT
 
tests/xfs/272 +5 -0
index 0a7a7273ac92..aa5831dc0234 100755
@@ -29,6 +29,11 @@ echo "Format and mount"
 _scratch_mkfs > "$seqres.full" 2>&1
 _scratch_mount
 
+# The synthetic devices for internal zoned rt devices confuse the parser
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 # Make sure everything is on the data device
 _xfs_force_bdev data $SCRATCH_MNT
 
tests/xfs/276 +5 -0
index b675e79b249a..2802fc03c473 100755
@@ -32,6 +32,11 @@ _scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs" >/dev/null
 cat "$tmp.mkfs" > $seqres.full
 _scratch_mount
 
+# The synthetic devices for internal zoned rt devices confuse the parser
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 # Don't let the rt extent size perturb the fsmap output with unwritten
 # extents in places we don't expect them
 test $rtextsz -eq $dbsize || _notrun "Skipping test due to rtextsize > 1 fsb"
tests/xfs/306 +4 -0
index 8981cbd72e1c..d48b753632d5 100755
@@ -33,6 +33,10 @@ unset SCRATCH_RTDEV
 _scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1
 _scratch_mount
 
+# When using the zone allocator, mkfs still creates an internal RT section by
+# default and the above unsetting SCRATCH_RTDEV of doesn't work.
+_require_xfs_scratch_non_zoned
+
 # Fill a source directory with many largish-named files. 1k uuid-named entries
 # sufficiently populates a 64k directory block.
 mkdir $SCRATCH_MNT/src
tests/xfs/419 +3 -0
index 5e122a0b8763..94ae18743da9 100755
@@ -44,6 +44,9 @@ cat $tmp.mkfs >> $seqres.full
 . $tmp.mkfs
 _scratch_mount
 
+# no support for rtextsize > 1 on zoned file systems
+_require_xfs_scratch_non_zoned
+
 test $rtextsz -ne $dbsize || \
 	_notrun "cannot set rt extent size ($rtextsz) larger than fs block size ($dbsize)"
 
tests/xfs/449 +3 -0
index a739df50e319..d93d84952c6a 100755
@@ -38,6 +38,9 @@ fi
 
 _scratch_mount
 
+# can't grow data volume on mixed configs
+_require_xfs_scratch_non_zoned
+
 $XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
 echo SPACEMAN >> $seqres.full
 cat $tmp.spaceman >> $seqres.full
tests/xfs/521 +3 -0
index c92c621a2fd4..0da05a55a276 100755
@@ -43,6 +43,9 @@ export SCRATCH_RTDEV=$rtdev
 _scratch_mkfs -r size=100m > $seqres.full
 _try_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume"
 
+# zoned file systems only support zoned size-rounded RT device sizes
+_require_xfs_scratch_non_zoned
+
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
tests/xfs/524 +4 -0
index ef47a8461bf7..6251863476e5 100755
@@ -25,6 +25,10 @@ _require_test
 _require_scratch_nocheck
 _require_xfs_mkfs_cfgfile
 
+# reflink is currently not supported for zoned devices, and the normal support
+# checks for it don't work at mkfs time.
+_require_non_zoned_device $SCRATCH_DEV
+
 echo "Silence is golden"
 
 def_cfgfile=$TEST_DIR/a
tests/xfs/540 +3 -0
index 9c0fa3c6bb10..5595eee85a9b 100755
@@ -34,6 +34,9 @@ test $rtextsz -ne $dbsize || \
 	_notrun "cannot set rt extent size ($rtextsz) larger than fs block size ($dbsize)"
 
 _scratch_mount >> $seqres.full 2>&1
+# no support for rtextsize > 1 on zoned file systems
+_require_xfs_scratch_non_zoned
+
 rootino=$(stat -c '%i' $SCRATCH_MNT)
 _scratch_unmount
 
tests/xfs/541 +3 -0
index b4856d496d5e..2b8c7ba17ff8 100755
@@ -30,6 +30,9 @@ _require_scratch
 SCRATCH_RTDEV="" _scratch_mkfs | _filter_mkfs 2> $tmp.mkfs >> $seqres.full
 _try_scratch_mount || _notrun "Can't mount file system"
 
+# Zoned file systems don't support rtextsize > 1
+_require_xfs_scratch_non_zoned
+
 # Check that there's no realtime section.
 source $tmp.mkfs
 test $rtblocks -eq 0 || echo "expected 0 rtblocks, got $rtblocks"
tests/xfs/556 +13 -0
index 83d5022e700c..f5ad90c869ba 100755
@@ -35,6 +35,19 @@ filter_scrub_errors() {
 }
 
 _scratch_mkfs >> $seqres.full
+
+#
+# The dm-error map added by this test doesn't work on zoned devices because
+# table sizes need to be aligned to the zone size, and even for zoned on
+# conventional this test will get confused because of the internal RT device.
+#
+# That check requires a mounted file system, so do a dummy mount before setting
+# up DM.
+#
+_scratch_mount
+_require_xfs_scratch_non_zoned
+_scratch_unmount
+
 _dmerror_init
 _dmerror_mount >> $seqres.full 2>&1
 
tests/xfs/596 +3 -0
index 12c38c2e9604..5827f045b4e6 100755
@@ -44,6 +44,9 @@ _scratch_mkfs_xfs -rsize=${rtsize}m | _filter_mkfs 2> "$tmp.mkfs" >> $seqres.ful
 onemeginblocks=`expr 1048576 / $dbsize`
 _scratch_mount
 
+# growfs on zoned file systems only works on zone boundaries
+_require_xfs_scratch_non_zoned
+
 # We're growing the realtime device, so force new file creation there
 _xfs_force_bdev realtime $SCRATCH_MNT
 
Signature · 1 line
2.45.2
Reviewed-by on v1 11/13
#15 lore raw

Re: [PATCH 11/13] xfs: skip various tests when using the zoned allocator

Quoted 4 lines · Christoph Hellwig

Various file system features tested are incompatible with the zoned allocator. Add a _require_xfs_scratch_non_zoned to guard them.

LGTM now,

--D

Quoted 224 lines
---
 tests/xfs/015 |  7 +++++++
 tests/xfs/041 |  5 +++++
 tests/xfs/272 |  5 +++++
 tests/xfs/276 |  5 +++++
 tests/xfs/306 |  4 ++++
 tests/xfs/419 |  3 +++
 tests/xfs/449 |  3 +++
 tests/xfs/521 |  3 +++
 tests/xfs/524 |  4 ++++
 tests/xfs/540 |  3 +++
 tests/xfs/541 |  3 +++
 tests/xfs/556 | 13 +++++++++++++
 tests/xfs/596 |  3 +++
 13 files changed, 61 insertions(+)
tests/xfs/015 +7 -0
index acaace0ce103..ddb3e0911813 100755
@@ -38,6 +38,13 @@ _require_scratch
 # need 128M space, don't make any assumption
 _scratch_mkfs >/dev/null 2>&1
 _scratch_mount
+
+# This test tries to grow the data device, which doesn't work for internal
+# zoned RT devices
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 _require_fs_space $SCRATCH_MNT 196608
 _scratch_unmount
 
tests/xfs/041 +5 -0
index 780078d44eeb..6cbcef6cfff0 100755
@@ -44,6 +44,11 @@ bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
 onemeginblocks=`expr 1048576 / $bsize`
 _scratch_mount
 
+# Growing the data device doesn't work with an internal RT volume directly
+# following the data device.  But even without that this test forces data
+# to the data device, which often is tiny on zoned file systems.
+_require_xfs_scratch_non_zoned
+
 # We're growing the data device, so force new file creation there
 _xfs_force_bdev data $SCRATCH_MNT
 
tests/xfs/272 +5 -0
index 0a7a7273ac92..aa5831dc0234 100755
@@ -29,6 +29,11 @@ echo "Format and mount"
 _scratch_mkfs > "$seqres.full" 2>&1
 _scratch_mount
 
+# The synthetic devices for internal zoned rt devices confuse the parser
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 # Make sure everything is on the data device
 _xfs_force_bdev data $SCRATCH_MNT
 
tests/xfs/276 +5 -0
index b675e79b249a..2802fc03c473 100755
@@ -32,6 +32,11 @@ _scratch_mkfs | _filter_mkfs 2> "$tmp.mkfs" >/dev/null
 cat "$tmp.mkfs" > $seqres.full
 _scratch_mount
 
+# The synthetic devices for internal zoned rt devices confuse the parser
+if [ -z "$SCRATCH_RTDEV" ]; then
+	_require_xfs_scratch_non_zoned
+fi
+
 # Don't let the rt extent size perturb the fsmap output with unwritten
 # extents in places we don't expect them
 test $rtextsz -eq $dbsize || _notrun "Skipping test due to rtextsize > 1 fsb"
tests/xfs/306 +4 -0
index 8981cbd72e1c..d48b753632d5 100755
@@ -33,6 +33,10 @@ unset SCRATCH_RTDEV
 _scratch_mkfs_xfs -d size=100m -n size=64k >> $seqres.full 2>&1
 _scratch_mount
 
+# When using the zone allocator, mkfs still creates an internal RT section by
+# default and the above unsetting SCRATCH_RTDEV of doesn't work.
+_require_xfs_scratch_non_zoned
+
 # Fill a source directory with many largish-named files. 1k uuid-named entries
 # sufficiently populates a 64k directory block.
 mkdir $SCRATCH_MNT/src
tests/xfs/419 +3 -0
index 5e122a0b8763..94ae18743da9 100755
@@ -44,6 +44,9 @@ cat $tmp.mkfs >> $seqres.full
 . $tmp.mkfs
 _scratch_mount
 
+# no support for rtextsize > 1 on zoned file systems
+_require_xfs_scratch_non_zoned
+
 test $rtextsz -ne $dbsize || \
 	_notrun "cannot set rt extent size ($rtextsz) larger than fs block size ($dbsize)"
 
tests/xfs/449 +3 -0
index a739df50e319..d93d84952c6a 100755
@@ -38,6 +38,9 @@ fi
 
 _scratch_mount
 
+# can't grow data volume on mixed configs
+_require_xfs_scratch_non_zoned
+
 $XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman
 echo SPACEMAN >> $seqres.full
 cat $tmp.spaceman >> $seqres.full
tests/xfs/521 +3 -0
index c92c621a2fd4..0da05a55a276 100755
@@ -43,6 +43,9 @@ export SCRATCH_RTDEV=$rtdev
 _scratch_mkfs -r size=100m > $seqres.full
 _try_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume"
 
+# zoned file systems only support zoned size-rounded RT device sizes
+_require_xfs_scratch_non_zoned
+
 testdir=$SCRATCH_MNT/test-$seq
 mkdir $testdir
 
tests/xfs/524 +4 -0
index ef47a8461bf7..6251863476e5 100755
@@ -25,6 +25,10 @@ _require_test
 _require_scratch_nocheck
 _require_xfs_mkfs_cfgfile
 
+# reflink is currently not supported for zoned devices, and the normal support
+# checks for it don't work at mkfs time.
+_require_non_zoned_device $SCRATCH_DEV
+
 echo "Silence is golden"
 
 def_cfgfile=$TEST_DIR/a
tests/xfs/540 +3 -0
index 9c0fa3c6bb10..5595eee85a9b 100755
@@ -34,6 +34,9 @@ test $rtextsz -ne $dbsize || \
 	_notrun "cannot set rt extent size ($rtextsz) larger than fs block size ($dbsize)"
 
 _scratch_mount >> $seqres.full 2>&1
+# no support for rtextsize > 1 on zoned file systems
+_require_xfs_scratch_non_zoned
+
 rootino=$(stat -c '%i' $SCRATCH_MNT)
 _scratch_unmount
 
tests/xfs/541 +3 -0
index b4856d496d5e..2b8c7ba17ff8 100755
@@ -30,6 +30,9 @@ _require_scratch
 SCRATCH_RTDEV="" _scratch_mkfs | _filter_mkfs 2> $tmp.mkfs >> $seqres.full
 _try_scratch_mount || _notrun "Can't mount file system"
 
+# Zoned file systems don't support rtextsize > 1
+_require_xfs_scratch_non_zoned
+
 # Check that there's no realtime section.
 source $tmp.mkfs
 test $rtblocks -eq 0 || echo "expected 0 rtblocks, got $rtblocks"
tests/xfs/556 +13 -0
index 83d5022e700c..f5ad90c869ba 100755
@@ -35,6 +35,19 @@ filter_scrub_errors() {
 }
 
 _scratch_mkfs >> $seqres.full
+
+#
+# The dm-error map added by this test doesn't work on zoned devices because
+# table sizes need to be aligned to the zone size, and even for zoned on
+# conventional this test will get confused because of the internal RT device.
+#
+# That check requires a mounted file system, so do a dummy mount before setting
+# up DM.
+#
+_scratch_mount
+_require_xfs_scratch_non_zoned
+_scratch_unmount
+
 _dmerror_init
 _dmerror_mount >> $seqres.full 2>&1
 
tests/xfs/596 +3 -0
index 12c38c2e9604..5827f045b4e6 100755
@@ -44,6 +44,9 @@ _scratch_mkfs_xfs -rsize=${rtsize}m | _filter_mkfs 2> "$tmp.mkfs" >> $seqres.ful
 onemeginblocks=`expr 1048576 / $dbsize`
 _scratch_mount
 
+# growfs on zoned file systems only works on zone boundaries
+_require_xfs_scratch_non_zoned
+
 # We're growing the realtime device, so force new file creation there
 _xfs_force_bdev realtime $SCRATCH_MNT
 
Signature · 1 line
2.45.2
#16 lore raw

PATCH 12/13 xfs/049: skip on zoned devices

In reply to Christoph Hellwig

This tes creates an ext2 file system, which doesn't support zoned devices.

---
 tests/xfs/049 | 2 ++
 1 file changed, 2 insertions(+)
tests/xfs/049 +2 -0
index cdcddf76498c..07feb58c9ad6 100755
@@ -40,6 +40,8 @@ _require_scratch_nocheck
 _require_no_large_scratch_dev
 _require_loop
 _require_extra_fs ext2
+# this test actually runs ext2 on the scratch device
+_require_non_zoned_device $SCRATCH_DEV
 
 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full
 echo "" >> $seqres.full
Signature · 1 line
2.45.2
Reviewed-by on v1 12/13
#17 lore raw

Re: [PATCH 12/13] xfs/049: skip on zoned devices

Quoted 4 lines · Christoph Hellwig

This tes creates an ext2 file system, which doesn't support zoned devices.

Looks ok,

--D

Quoted 21 lines
---
 tests/xfs/049 | 2 ++
 1 file changed, 2 insertions(+)
tests/xfs/049 +2 -0
index cdcddf76498c..07feb58c9ad6 100755
@@ -40,6 +40,8 @@ _require_scratch_nocheck
 _require_no_large_scratch_dev
 _require_loop
 _require_extra_fs ext2
+# this test actually runs ext2 on the scratch device
+_require_non_zoned_device $SCRATCH_DEV
 
 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full
 echo "" >> $seqres.full
Signature · 1 line
2.45.2
#18 lore raw

PATCH 13/13 xfs/206: filter out the zoned line from mkfs output

In reply to Christoph Hellwig

So that the test still passes with a zone enabled mkfs.

---
 tests/xfs/206 | 1 +
 1 file changed, 1 insertion(+)
tests/xfs/206 +1 -0
index 01531e1f08c3..bfd2dee939dd 100755
@@ -66,6 +66,7 @@ mkfs_filter()
 	    -e '/metadir=.*/d' \
 	    -e 's/, parent=[01]//' \
 	    -e '/rgcount=/d' \
+	    -e '/zoned=/d' \
 	    -e "/^Default configuration/d"
 }
 
Signature · 1 line
2.45.2