From 680b5c171f58cb72a771524f2929bcb2be52f52d Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 3 Sep 2019 16:16:29 +0800 Subject: [PATCH] btrfs-progs: tests: Add new images for inode mode repair functionality Add new test image for imode repair in subvolume trees. The new test cases including the following cases: - Regular file with bad imode It still has the valid INODE_REF and parent dir has correct DIR_INDEX and DIR_ITEM. In this case, no matter if the file is empty or not, it should be repaired using the info from DIR_INDEX of parent dir. - Non-empty regular file with bad imode, and without INODE_REF The file should be mostly an orphan, so no INODE_REF for imode lookup. But it has EXTENT_DATA which should be enough for imode repair. The repair also involves moving the orphan to lost+found dir. - Non-empty dir with bad imode, and without INODE_REF Pretty much the same case, but now a directory. The repair also involves moving the orphan to lost+found dir. Also rename the existing test case 039-bad-free-space-cache-inode-mode to 039-bad-inode-mode, since now we can fix all bad imode. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- .../039-bad-inode-mode/.lowmem_repairable | 0 .../bad_free_space_cache_imode.raw.xz} | Bin .../bad_imodes_in_subvolume_tree.img.xz | Bin 0 -> 2956 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/fsck-tests/039-bad-inode-mode/.lowmem_repairable rename tests/fsck-tests/{039-bad-free-space-cache-inode-mode/test.raw.xz => 039-bad-inode-mode/bad_free_space_cache_imode.raw.xz} (100%) create mode 100644 tests/fsck-tests/039-bad-inode-mode/bad_imodes_in_subvolume_tree.img.xz diff --git a/tests/fsck-tests/039-bad-inode-mode/.lowmem_repairable b/tests/fsck-tests/039-bad-inode-mode/.lowmem_repairable new file mode 100644 index 00000000..e69de29b diff --git a/tests/fsck-tests/039-bad-free-space-cache-inode-mode/test.raw.xz b/tests/fsck-tests/039-bad-inode-mode/bad_free_space_cache_imode.raw.xz similarity index 100% rename from tests/fsck-tests/039-bad-free-space-cache-inode-mode/test.raw.xz rename to tests/fsck-tests/039-bad-inode-mode/bad_free_space_cache_imode.raw.xz diff --git a/tests/fsck-tests/039-bad-inode-mode/bad_imodes_in_subvolume_tree.img.xz b/tests/fsck-tests/039-bad-inode-mode/bad_imodes_in_subvolume_tree.img.xz new file mode 100644 index 0000000000000000000000000000000000000000..8c51ceb7703de8ab36ca8cdd95117c0e13174a04 GIT binary patch literal 2956 zcmV;73v=}SH+ooF000E$*0e?f03iV!0000G&sfah5C02HT>wRyj;C3^v%$$4d1wdA zhA1@4m*CN4=JF(pu<{lZu#3rJ{x`%OunHJR_+hWlU+8THA!o)hf&JdREq$B_jm%57 z$k$@1L{^~@)eO=~d}4!Pg}&?=WZA7?y^i8Ts&#ea0yyltsLU^Gf(TifcWf2aWO^hn zT;ywyIWc#F)mQ1BE%<IyvimyUvJNB2|Mo)Fslt`UpOQyH!=GhdIIJ&nXNptS z5>-zoXN+mR|Kd!b>C`pZDeSL|dDc0q=cne=*q|$_u;Mtdv?NB&jsm4$!H89N@6MB_s-=sZq}74cMD0lH(sU%^^o(ot<{|r ztKcf34B*6NDzb{6fNLhf#qlKT$4j{W?U3x@9tTUgT-SQV!UupoQ0*1oJ%yJ2AJpTq z)t*CBp6+TJ<_{;}@x`nd|M|6rNs7b8o3*)M4V)W!cBsPyse$nadTV-@mRqa*8RJ6T zN;J^~^kAFH)?Yp!@{r0RfVvKLB648Rw>FfV&>>sPR@3sL-8$vOW*Xp*pk6KqU-Xu= z{c;{BM3?BGNh`Zo7f3aGos=%*7AcwH>)0H*&cn?Z)eV9%X3UUy2=&{9w;hyR#n; z^vqkBZJT!$=Si(K zXmuumG*qGca*78hB`%Qr-9e=$wk*5W#FT@FDgT$zyoq`&e5c&Z|myJLIen*rd~ z?U9nHIiX zHr2jRZOlBcw~4T}&bOi^*fRD&d4`;@WoO7WfZ85%*TAh7Sh)BI>CT_J4@qLDUKcAi zI2J_;@x;{-?iKAO1|G|c)&sC#l5|FJYxTQ0l+-iFC5D@A1Ss+Khw)wjEgp-t5)utZPx2rs6;DKf|h;Ye#hdOjHXI zxGp7R2=d_&J`%<#g@`UXKZ%%jf>fXypwGrw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