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>
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
_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)" ] && \
_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
_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