From b3417b02aa6b2d8549d7749da4f012205bbe06e2 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Tue, 11 Aug 2020 19:44:51 +0800 Subject: [PATCH] btrfs-progs: tests: enhance invalid extent item generation test cases This patch will: - Add a new test image for fsck/044 This new image has a corrupted extent item generation for tree block. This image can expose a bug in original mode, which can't detect the problem. This image also utilize the tree block generation detection code, which the existing image doesn't. - Rename the existing image To reflect the fact that the existing one is only for data extent. - Remove the test.sh So that the generic path will test both detection and repair. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- ...xz => bad_extent_item_gen_for_data.img.xz} | Bin .../bad_extent_item_gen_for_tree_block.img.xz | Bin 0 -> 1804 bytes .../test.sh | 19 ------------------ 3 files changed, 19 deletions(-) rename tests/fsck-tests/044-invalid-extent-item-generation/{bad_extent_item_gen.img.xz => bad_extent_item_gen_for_data.img.xz} (100%) create mode 100644 tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz delete mode 100755 tests/fsck-tests/044-invalid-extent-item-generation/test.sh diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_data.img.xz similarity index 100% rename from tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen.img.xz rename to tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_data.img.xz diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz b/tests/fsck-tests/044-invalid-extent-item-generation/bad_extent_item_gen_for_tree_block.img.xz new file mode 100644 index 0000000000000000000000000000000000000000..8bc4688dea9c952282b7124fc53175fe1ebd9c4f GIT binary patch literal 1804 zcmV+n2lM#-H+ooF000E$*0e?f03iVu0001VFXf})3;zbpT>wRyj;C3^v%$$4d1r37 zhA1?^)FbHPU9kp;^;z}hd0uY6;LD=U60GHY?DqG?;$J@7&n~-@@yINgS5;J_=Cc9dL7B zN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Ll}6rS)PEp0gDbr{Xo+O$28sst$Oe-RamPVAYJUah zqX&*fLq%RdZycR2lu2y(LPeiJ_UMv?(7*)@K@g#b4{#_h^eN#qpPNnWdvVF;?_>f1w4))GK6pX;8fo5^ zEIIUB9875Kle1R#DG=du!cGN%=>vflEb@zJKgFp`Olk@hh@19dH3U(V{blfW$rI_o zm7Tt%y9mGy$f7K--5o1C6DA2DFo(TPk}0IDCM_-w_mQlf&?gwsCp(-!-_Nb1q5Lpt z;6YLZ+iM_Sw>|)4$vME%rs0Lex0A+Ds>_@JV(TACAG0 z_VjGm_3w$?DW}C3Q|VKr3rTxPet5RXXEe4wTCVm7z zgbT_JX7U literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/044-invalid-extent-item-generation/test.sh b/tests/fsck-tests/044-invalid-extent-item-generation/test.sh deleted file mode 100755 index 2b88a3c7..00000000 --- a/tests/fsck-tests/044-invalid-extent-item-generation/test.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# -# Due to a bug in --init-extent-tree option, we may create bad generation -# number for data extents. -# -# This test case will ensure btrfs check can at least detect such problem, -# just like kernel tree-checker. - -source "$TEST_TOP/common" - -check_prereq btrfs - -check_image() { - run_mustfail \ - "btrfs check failed to detect invalid extent item generation" \ - "$TOP/btrfs" check "$1" -} - -check_all_images