btrfs-progs: mkfs: add artificial dependency for block group tree

To reduce the test matrix and to follow the kernel behavior, make sure
for block-group-tree feature, we have no-holes and free-space-tree
features enabled.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2022-08-09 14:03:55 +08:00 committed by David Sterba
parent 2f2f6bfe17
commit 1c414061ed

View file

@ -1303,6 +1303,13 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
}
}
/* Block group tree feature requires no-holes and free-space-tree. */
if (runtime_features & BTRFS_RUNTIME_FEATURE_BLOCK_GROUP_TREE &&
(!(features & BTRFS_FEATURE_INCOMPAT_NO_HOLES) ||
!(runtime_features & BTRFS_RUNTIME_FEATURE_FREE_SPACE_TREE))) {
error("block group tree requires no-holes and free-space-tree features");
exit(1);
}
if (zoned) {
if (source_dir_set) {
error("the option -r and zoned mode are incompatible");