From: Josef Bacik Date: Tue, 19 Mar 2024 18:12:03 +0000 (+0100) Subject: btrfs/131,btrfs/172,btrfs/206: add check for block-group-tree feature in btrfs X-Git-Tag: v2024.03.31~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5349754597997337f2126d889bac94f40798056f;p=xfstests-dev.git btrfs/131,btrfs/172,btrfs/206: add check for block-group-tree feature in btrfs A new disk format option will make the no-holes option a requirement, so add a helper to make sure that we aren't creating a fs with BLOCK_GROUP_TREE by default, and skip the tests that require turning off no-holes. Reviewed-by: Anand Jain Signed-off-by: Josef Bacik Signed-off-by: Anand Jain --- diff --git a/common/btrfs b/common/btrfs index ae13fb55..99bd5ace 100644 --- a/common/btrfs +++ b/common/btrfs @@ -148,6 +148,16 @@ _require_btrfs_free_space_tree() fi } +_require_btrfs_no_block_group_tree() +{ + _scratch_mkfs > /dev/null 2>&1 + if $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | \ + grep -q "BLOCK_GROUP_TREE" + then + _notrun "This test requires no block-group-tree" + fi +} + _check_btrfs_filesystem() { device=$1 diff --git a/tests/btrfs/131 b/tests/btrfs/131 index 529ee3e8..d34fc8d5 100755 --- a/tests/btrfs/131 +++ b/tests/btrfs/131 @@ -20,6 +20,8 @@ _require_btrfs_command inspect-internal dump-super _require_btrfs_fs_feature free_space_tree # Zoned btrfs does not support space_cache(v1) _require_non_zoned_device "${SCRATCH_DEV}" +# Block group tree does not support space_cache(v1) +_require_btrfs_no_block_group_tree _scratch_mkfs >/dev/null 2>&1 [ "$(_get_page_size)" -gt "$(_scratch_btrfs_sectorsize)" ] && \ diff --git a/tests/btrfs/172 b/tests/btrfs/172 index f2997c04..964251b4 100755 --- a/tests/btrfs/172 +++ b/tests/btrfs/172 @@ -32,6 +32,9 @@ _require_scratch _require_log_writes _require_xfs_io_command "sync_range" +# block-group-tree requires no-holes +_require_btrfs_no_block_group_tree + _log_writes_init $SCRATCH_DEV _log_writes_mkfs "-O ^no-holes" >> $seqres.full 2>&1 diff --git a/tests/btrfs/206 b/tests/btrfs/206 index 6ac3d27b..02a50820 100755 --- a/tests/btrfs/206 +++ b/tests/btrfs/206 @@ -33,6 +33,9 @@ _require_log_writes _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fpunch" +# block-group-tree requires no-holes +_require_btrfs_no_block_group_tree + _log_writes_init $SCRATCH_DEV _log_writes_mkfs "-O ^no-holes" >> $seqres.full 2>&1