All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
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	[thread overview]
Message-ID: <20200810072747.64439-5-wqu@suse.com> (raw)
In-Reply-To: <20200810072747.64439-1-wqu@suse.com>

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 <wqu@suse.com>
---
 ...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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%8ML;O
z^OJ%g8l%*xT#n54K&y6a5wMD&7}pNUxm$rg^ITK>E%rs0Lex0A+Ds>_@JV(TACAG0
z_VjGm_3w$?DW}C3Q|VKr3rTxPet5RXXEe4wTC<wn1+7)xX0l#~c7%Jf8=kb->Vm7z
zgbT<c;GBap===Tc^#-NK^V9jn3zJ;m;Y4HTe~Ch(LFlaWrsNt1dHB+%6?@K(`iWk{
uRmzh^`2FUoKmY(Kp+~(ct|%q|0q6~Y7ytlp&AvXd#Ao{g000001X)_>_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
-- 
2.28.0


      parent reply	other threads:[~2020-08-10  7:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-10  7:27 [PATCH 0/4] btrfs-progs: check: add the ability to repair extent item generation corruption Qu Wenruo
2020-08-10  7:27 ` [PATCH 1/4] btrfs-progs: check/lowmem: add the ability to repair extent item generation Qu Wenruo
2020-08-10  7:30   ` Johannes Thumshirn
2020-08-10  7:35     ` Qu Wenruo
2020-08-10  7:27 ` [PATCH 2/4] btrfs-progs: check/original: don't reset extent generation for check_block() Qu Wenruo
2020-08-10  7:27 ` [PATCH 3/4] btrfs-progs: check/original: add the ability to repair extent item generation Qu Wenruo
2020-08-10  7:27 ` Qu Wenruo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200810072747.64439-5-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.