[v3,6/6] btrfs-progs: tests/fsck: Add new images for inode mode repair functionality
diff mbox series

Message ID 20190912031135.79696-7-wqu@suse.com
State New
Headers show
Series
  • btrfs-progs: check: Repair invalid inode mode in subvolume trees
Related show

Commit Message

Qu Wenruo Sept. 12, 2019, 3:11 a.m. UTC
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 <wqu@suse.com>
---
 .../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

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;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oWO$D(Way2no^hku8Pz1pWbZuL+;U>H23;O
zPL7o4aJ|KzTvxL1NzwZd=+$Xo;laWSMA%^oj{=QiiKM?8bI?5yetUrl7zxj*2&-y`
zJt7RLK}Ra%xm&Dx*esCUbgs2^?_I4?KU8~fk1IIWMYu$@krs~4uE9z)2;2m*6-n>v
zv}GC4O-`b51PG|-ihyj=15#l?)S~T4chV>Rxjq}2LL3R9Q+vt1jU<5-NDyd|gtWWB
zPWvZ=#`d1IP(ZcMGGP0+oz$w|%XxC{Sqb)?*^*&;8Lh#)ml)@g&Vyq$@PaJZ=X<MB
z9AzY3msfb2w<3F#1)TtYWk&WfhcNTNpd{A<+11etiTF<jl*L_mz*+_MY@~}6s5%H8
zPy!k3@u-*Dt92l#9GG;*G-})K6Z`4U<f@(+6crqiQbkY$oIQyHR)ds$DP%}_P#$w(
z6-9zYiL&5lzR=Wj4Qu7Dd4K?%uV+$>fi3g^0q7QhAOHZ%-}VEs#Ao{g000001X)^D
C1kMfs

literal 0
HcmV?d00001

Patch
diff mbox series

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 000000000000..e69de29bb2d1
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