btrfs-progs: tests/fsck: add test image with invalid metadata backref level

The image has a key in extent tree, (30457856 METADATA_ITEM 256), which
has invalid level (256 > BTRFS_MAX_LEVEL).

Make sure check can at least detect such problem.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2022-01-17 10:38:50 +08:00 committed by David Sterba
parent 1a8f283c97
commit 2f734d7b2c
2 changed files with 19 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,19 @@
#!/bin/bash
#
# Verify that check can detect invalid metadata backref level.
#
# There is a report that btrfs-check original mode doesn't report invalid
# metadata backref level, and lowmem mode would just crash.
#
# Make sure btrfs check can at least detect such error.
source "$TEST_TOP/common"
check_prereq btrfs
check_image() {
run_mustfail "invalid metadata backref level not detected" \
"$TOP/btrfs" check "$1"
}
check_all_images