Skip to content

Commit 6bf82ad

Browse files
adam900710kdave
authored andcommitted
btrfs-progs: tests: tests: add a test case for convert with bgt feature
Previously "btrfs-convert -O bgt" would not cause any error, but the resulting fs has no block-group-tree feature at all, making it no different than "btrfs-convert -O ^bgt". This is a big bug that was never caught by our existing convert runs. 001-ext2-basic and 003-ext4-basic all tested bgt feature, but don't really check if the resulting fs really have bgt flags set. To fix that add a new test case, which will do the regular bgt convert, but at the end also do a super block dump and verify the BLOCK_GROUP_TREE flag is properly set. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 7da8fd0 commit 6bf82ad

File tree

1 file changed

+20
-0
lines changed
  • tests/convert-tests/028-block-group-tree

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
# Make sure btrfs-convert can create a fs with bgt feature.
3+
4+
source "$TEST_TOP/common" || exit
5+
source "$TEST_TOP/common.convert" || exit
6+
7+
setup_root_helper
8+
prepare_test_dev
9+
10+
check_global_prereq mkfs.ext4
11+
check_prereq btrfs-convert
12+
check_prereq btrfs
13+
14+
convert_test_prep_fs ext4 mke2fs -t ext4 -b 4096
15+
run_check_umount_test_dev
16+
convert_test_do_convert bgt 16384
17+
18+
# Manually check the super block to make sure it has BGT flag.
19+
run_check_stdout "$TOP/btrfs" inspect-internal dump-super "$TEST_DEV" |\
20+
grep -q "BLOCK_GROUP_TREE" || _fail "No block-group-tree feature enabled"

0 commit comments

Comments
 (0)