Commit 4acdcb5
committed
btrfs-progs: add a test case for unknown keys in subvolume trees
The image has the following corrupted key in fs tree:
item 4 key (257 INODE_ITEM 0) itemoff 15879 itemsize 160
generation 9 transid 9 size 0 nbytes 0
block group 0 mode 100644 links 1 uid 0 gid 0 rdev 0
sequence 1 flags 0x0(none)
item 5 key (257 UNKNOWN.8 256) itemoff 15879 itemsize 0 <<<
item 6 key (257 INODE_REF 256) itemoff 15863 itemsize 16
index 2 namelen 6 name: foobar
This is inspired by a real world memory bitflip, which lead to a bitflip
from 12 to 8, causing the above unknown key type in a subvolume.
Although we will need to properly enhance btrfs-check to handle such
case better, let's start from detecting and report such unknown keys as
an error.
The image is created by inserting an empty item with above unknown key
type.
Signed-off-by: Qu Wenruo <wqu@suse.com>1 parent 4f3fb9e commit 4acdcb5
File tree
2 files changed
+14
-0
lines changed- tests/fsck-tests/069-unknown-fs-tree-key
2 files changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Binary file not shown.
0 commit comments