]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/131,btrfs/172,btrfs/206: add check for block-group-tree feature in btrfs
authorJosef Bacik <josef@toxicpanda.com>
Tue, 19 Mar 2024 18:12:03 +0000 (19:12 +0100)
committerAnand Jain <anand.jain@oracle.com>
Sun, 24 Mar 2024 05:29:56 +0000 (13:29 +0800)
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 <anand.jain@oracle.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
common/btrfs
tests/btrfs/131
tests/btrfs/172
tests/btrfs/206

index ae13fb55cbc6326f23cdef2c40ed1f5103e408b2..99bd5ace674fbee94769322b3d23576d49e0ad7c 100644 (file)
@@ -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
index 529ee3e80f87ebecb2bd27197b267fa79e7c013a..d34fc8d53801b34436a5323081587e72df6ee321 100755 (executable)
@@ -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)" ] && \
index f2997c047effb027bcefc213b9803f3b04ad416a..964251b449de209ca1d9d98d0b47df0f1bacecd3 100755 (executable)
@@ -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
 
index 6ac3d27bbde3752543dad832457eb6e0bc5de077..02a5082046f4a5fb881e50d2a55d1a2e8b853089 100755 (executable)
@@ -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