diff options
authorSu Yue <>2017-07-14 15:47:46 +0800
committerDavid Sterba <>2017-08-24 19:07:58 +0200
commit515ea7dc2f28794b03b64bc962da79935a29b457 (patch)
parent7f3ba48000997c5a11e5ab8d3438d2e10c319702 (diff)
btrfs-progs: fsck-test: case for corrupted dir item name
In this test case, all name in dir_item, dir_index, inode_ref are corrupted to another one. btrfs check should report errors about the corrupted dir_item but btrfs can't repair the case now. Signed-off-by: Su Yue <> Signed-off-by: David Sterba <>
-rw-r--r--tests/fsck-tests/026-bad-dir-item-name/default_case.img.xzbin0 -> 1924 bytes
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz b/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz
new file mode 100644
index 00000000..27e8553f
--- /dev/null
+++ b/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz
Binary files differ
diff --git a/tests/fsck-tests/026-bad-dir-item-name/ b/tests/fsck-tests/026-bad-dir-item-name/
new file mode 100755
index 00000000..a1077a8d
--- /dev/null
+++ b/tests/fsck-tests/026-bad-dir-item-name/
@@ -0,0 +1,13 @@
+# confirm whether check detects name and hash mismatch in dir_item
+source "$TOP/tests/common"
+check_prereq btrfs
+image=$(extract_image "./default_case.img.xz")
+run_mustfail "dir_item hash mismatch not found" "$TOP/btrfs" check "$image"
+rm -f "$image"