diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz new file mode 100644 index 00000000..c3e30313 Binary files /dev/null and b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz differ diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/test.sh b/tests/fsck-tests/044-invalid-extent-item-generation/test.sh new file mode 100755 index 00000000..2b88a3c7 --- /dev/null +++ b/tests/fsck-tests/044-invalid-extent-item-generation/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Due to a bug in --init-extent-tree option, we may create bad generation +# number for data extents. +# +# This test case will ensure btrfs check can at least detect such problem, +# just like kernel tree-checker. + +source "$TEST_TOP/common" + +check_prereq btrfs + +check_image() { + run_mustfail \ + "btrfs check failed to detect invalid extent item generation" \ + "$TOP/btrfs" check "$1" +} + +check_all_images