mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-24 20:54:17 +08:00
btrfs-progs: tests: Add test image for dev extents beyond device boundary
Now two locations can detect such problem, either by device item used/total bytes check, or by early dev extents check against device boundary. The image is hand-crafted image which uses DATA SINGLE chunk to feed btrfs check. As expected, as long as block group item, chunk item, device used bytes match, older versions check can't detect such problem. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
39ea41f00b
commit
81275c8bf5
BIN
tests/fsck-tests/036-bad-dev-extents/over_dev_boundary.img.xz
Normal file
BIN
tests/fsck-tests/036-bad-dev-extents/over_dev_boundary.img.xz
Normal file
Binary file not shown.
20
tests/fsck-tests/036-bad-dev-extents/test.sh
Executable file
20
tests/fsck-tests/036-bad-dev-extents/test.sh
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Due to DUP chunk allocator bugs, we could allocate DUP chunks while its dev
|
||||
# extents could exist beyond device boundary.
|
||||
# And since all related items (block group, chunk, device used bytes) are all
|
||||
# valid, btrfs check won't report any error.
|
||||
#
|
||||
# This test case contains hand crafted minimal image, to test if btrfs check
|
||||
# can detect and report such error.
|
||||
|
||||
source "$TEST_TOP/common"
|
||||
|
||||
check_prereq btrfs
|
||||
|
||||
check_image() {
|
||||
run_mustfail "btrfs check failed to detect invalid dev extents" \
|
||||
"$TOP/btrfs" check "$1"
|
||||
}
|
||||
|
||||
check_all_images
|
Loading…
Reference in New Issue
Block a user