From 515ea7dc2f28794b03b64bc962da79935a29b457 Mon Sep 17 00:00:00 2001 From: Su Yue Date: Fri, 14 Jul 2017 15:47:46 +0800 Subject: [PATCH] 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 --- .../026-bad-dir-item-name/default_case.img.xz | Bin 0 -> 1924 bytes tests/fsck-tests/026-bad-dir-item-name/test.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz create mode 100755 tests/fsck-tests/026-bad-dir-item-name/test.sh 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 0000000000000000000000000000000000000000..27e8553f103095170420c0e115cab4bc889c2af5 GIT binary patch literal 1924 zcmV-~2YdMaH+ooF000E$*0e?f03iVu0001VFXf})3;zd1T>wRyj;C3^v%$$4d1t#p zhBKh;(bwue6)D<_5I7>z%J5C)A&&>6?lo!ie$bd8`v{))yg-I115-YV9jb8*`6ewW5dkL0VJ!mGw#6N}r7O<=P$+06!#(6z$ zQ-qKke^l``Br3vi-@nY?1Up5a&_re&qm!%H09%ORTP~kW$v)JIHLIBexyZ*;><1ow zr#eZqnG+0`>LMC6325!C_!VaP{+i1+WOu3KUqSPYzFHfb?jG0#?pb0a)Od6k;Peu{ z;fQ;)UJ-6DYf%EMosl<1AJtQPUS5Vn)X}$uxbkT`cUvZ>E`$=lzI?j;WtM+nj9>Ai z-1l~Q%QyUA=MebWEgmO!qe|t&v}`%Ewu*6@vSe&KpHK=DsAVmvZw~oHC&EfL&D2u4 zcTH!@*a1;Pp-p)0*~r;Q_eQjzw)m2ht4W3&=rhKmEpszT!SpUtN6z=jF?E|hPsscO z6w^_{WGEOZE8H?gf z*Ya~Y;lK4I6v3kn%XBvgqud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K000001X)^)|E<>m literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/026-bad-dir-item-name/test.sh b/tests/fsck-tests/026-bad-dir-item-name/test.sh new file mode 100755 index 00000000..a1077a8d --- /dev/null +++ b/tests/fsck-tests/026-bad-dir-item-name/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# 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"