public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests: btrfs/237: skip test on devices with conventional zones
@ 2025-06-26 13:18 Johannes Thumshirn
  2025-07-12 13:52 ` Anand Jain
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Thumshirn @ 2025-06-26 13:18 UTC (permalink / raw)
  To: Anand Jain; +Cc: Zorro Lang, fstests, linux-btrfs, Johannes Thumshirn

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Skip btrfs/237 on devices with conventional zones, as we cannot force data
allocation on a sequential zone at the moment and conventional zones
cannot be reset, making the test invalid.

Furthermore limit the output of get_data_bg() and get_data_bg_physical()
to the first address.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 tests/btrfs/237 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/btrfs/237 b/tests/btrfs/237
index 2839f6e4..25ed7bcf 100755
--- a/tests/btrfs/237
+++ b/tests/btrfs/237
@@ -28,7 +28,8 @@ get_data_bg()
 {
 	$BTRFS_UTIL_PROG inspect-internal dump-tree -t CHUNK $SCRATCH_DEV |\
 		grep -A 1 "CHUNK_ITEM" | grep -B 1 "type DATA" |\
-		grep -Eo "CHUNK_ITEM [[:digit:]]+" | cut -d ' ' -f 2
+		grep -Eo "CHUNK_ITEM [[:digit:]]+" | cut -d ' ' -f 2 |\
+		head -n 1
 }
 
 get_data_bg_physical()
@@ -36,9 +37,13 @@ get_data_bg_physical()
 	# Assumes SINGLE data profile
 	$BTRFS_UTIL_PROG inspect-internal dump-tree -t CHUNK $SCRATCH_DEV |\
 		grep -A 4 CHUNK_ITEM | grep -A 3 'type DATA\|SINGLE' |\
-	        grep -Eo 'offset [[:digit:]]+'| cut -d ' ' -f 2
+	        grep -Eo 'offset [[:digit:]]+'| cut -d ' ' -f 2 |\
+		head -n 1
 }
 
+$BLKZONE_PROG report $SCRATCH_DEV | grep -q -e "nw" && \
+	_notrun "test is unreliable on devices with conventional zones"
+
 sdev="$(_short_dev $SCRATCH_DEV)"
 zone_size=$(($(cat /sys/block/${sdev}/queue/chunk_sectors) << 9))
 fssize=$((zone_size * 16))
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-14  2:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 13:18 [PATCH] tests: btrfs/237: skip test on devices with conventional zones Johannes Thumshirn
2025-07-12 13:52 ` Anand Jain
2025-07-16  7:57   ` Johannes Thumshirn
2025-08-14  2:16     ` Anand Jain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox