From patchwork Mon Aug 10 07:27:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 11707057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9AB01138C for ; Mon, 10 Aug 2020 07:28:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B1F02073E for ; Mon, 10 Aug 2020 07:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbgHJH2M (ORCPT ); Mon, 10 Aug 2020 03:28:12 -0400 Received: from mx2.suse.de ([195.135.220.15]:39584 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgHJH2F (ORCPT ); Mon, 10 Aug 2020 03:28:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2BC4BB57A for ; Mon, 10 Aug 2020 07:28:23 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/4] btrfs-progs: tests/fsck: enhance invalid extent item geneartion test cases Date: Mon, 10 Aug 2020 15:27:47 +0800 Message-Id: <20200810072747.64439-5-wqu@suse.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200810072747.64439-1-wqu@suse.com> References: <20200810072747.64439-1-wqu@suse.com> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 --- ...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 zN4xqjn$s-kB+$5w4{LyCOgp;a5;Z2xz;CpYuj_0*JeeG5T+}V-^ry>fDCR@vU*(g_ z8Crk;o~G|EmQGR*14yLgA5ejgD{&-AEdxl6SaY@m<;&SQ6F_?0i7w^fM4;DH7E>_5 zEx|RXaLKl;EJak`N+OBlnYuP|5(p95Ag%i%U3p<D1xtJ#L@vshswTiMkwbvk_-d*ZdGhu-n^V~J{2bpba7i>?1{HS96V?>b5Rjm+!K z0r3s8xB!h}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lpt 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 2b88a3c7b3bb..000000000000 --- 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