linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 4/4] btrfs-progs: fsck-tests: Make 026-bad-dir-item-name test case to verify if btrfs-check can also repair it
Date: Thu, 25 Oct 2018 15:44:49 +0800	[thread overview]
Message-ID: <20181025074449.32469-5-wqu@suse.com> (raw)
In-Reply-To: <20181025074449.32469-1-wqu@suse.com>

Just remove the customized 'test.sh', then generic fsck test will do the
check-repair-check.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 .../026-bad-dir-item-name/description.txt     | 41 +++++++++++++++++++
 .../fsck-tests/026-bad-dir-item-name/test.sh  | 13 ------
 2 files changed, 41 insertions(+), 13 deletions(-)
 create mode 100644 tests/fsck-tests/026-bad-dir-item-name/description.txt
 delete mode 100755 tests/fsck-tests/026-bad-dir-item-name/test.sh

diff --git a/tests/fsck-tests/026-bad-dir-item-name/description.txt b/tests/fsck-tests/026-bad-dir-item-name/description.txt
new file mode 100644
index 000000000000..2bdb0f8179b0
--- /dev/null
+++ b/tests/fsck-tests/026-bad-dir-item-name/description.txt
@@ -0,0 +1,41 @@
+"default_case.img.xz" contains the fs with the following tree dump of fs tree:
+
+  [snip]
+	item 2 key (256 DIR_ITEM 751495445) itemoff 16019 itemsize 92
+		location key (259 INODE_ITEM 0) type FILE
+		transid 9 data_len 0 name_len 13
+		name: foor.WvG1c1Td
+		      ^^^^^^^^^^^^^ Hash doesn't match with key
+		location key (260 INODE_ITEM 0) type FILE
+		transid 12 data_len 0 name_len 19
+		name: user.J3__T_Km3dVsW_
+	item 3 key (256 DIR_INDEX 4) itemoff 15976 itemsize 43
+		location key (259 INODE_ITEM 0) type FILE
+		transid 9 data_len 0 name_len 13
+		name: foor.WvG1c1Td
+	item 4 key (256 DIR_INDEX 5) itemoff 15927 itemsize 49
+		location key (260 INODE_ITEM 0) type FILE
+		transid 12 data_len 0 name_len 19
+		name: user.J3__T_Km3dVsW_
+	item 5 key (259 INODE_ITEM 0) itemoff 15767 itemsize 160
+		generation 9 transid 9 size 0 nbytes 0
+		block group 0 mode 100644 links 1 uid 0 gid 0 rdev 0
+		sequence 1 flags 0x0(none)
+		atime 1499844359.341125147 (2017-07-12 15:25:59)
+		ctime 1499844359.341125147 (2017-07-12 15:25:59)
+		mtime 1499844359.341125147 (2017-07-12 15:25:59)
+		otime 1499844359.341125147 (2017-07-12 15:25:59)
+	item 6 key (259 INODE_REF 256) itemoff 15744 itemsize 23
+		index 4 namelen 13 name: foor.WvG1c1Td
+	item 7 key (260 INODE_ITEM 0) itemoff 15584 itemsize 160
+		generation 12 transid 12 size 0 nbytes 0
+		block group 0 mode 100644 links 1 uid 0 gid 0 rdev 0
+		sequence 1 flags 0x0(none)
+		atime 1499844544.931130070 (2017-07-12 15:29:04)
+		ctime 1499844544.931130070 (2017-07-12 15:29:04)
+		mtime 1499844544.931130070 (2017-07-12 15:29:04)
+		otime 1499844544.931130070 (2017-07-12 15:29:04)
+	item 8 key (260 INODE_REF 256) itemoff 15555 itemsize 29
+		index 5 namelen 19 name: user.J3__T_Km3dVsW_
+
+Test case is going to check if btrfs check can detect and repair it.
diff --git a/tests/fsck-tests/026-bad-dir-item-name/test.sh b/tests/fsck-tests/026-bad-dir-item-name/test.sh
deleted file mode 100755
index a38bf045ae82..000000000000
--- a/tests/fsck-tests/026-bad-dir-item-name/test.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-#
-# confirm whether check detects name and hash mismatch in dir_item
-
-source "$TEST_TOP/common"
-
-check_prereq btrfs
-
-image=$(extract_image "./default_case.img.xz")
-
-run_mustfail "dir_item hash mismatch not found" "$TOP/btrfs" check "$image"
-
-rm -f "$image"
-- 
2.19.1


  parent reply	other threads:[~2018-10-25  7:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25  7:44 [PATCH 0/4] btrfs-progs: check: Add repair support for mismatch dir item hash Qu Wenruo
2018-10-25  7:44 ` [PATCH 1/4] btrfs-progs: lowmem check: Add ability to repair dir item with mismatch hash Qu Wenruo
2018-10-25  7:44 ` [PATCH 2/4] btrfs-progs: original check: Use mismatch_dir_hash_record to record bad dir items Qu Wenruo
2018-10-25  7:44 ` [PATCH 3/4] btrfs-progs: original check: Add ability to repair dir item with invalid hash Qu Wenruo
2018-10-25  7:44 ` Qu Wenruo [this message]
2019-01-07  6:51 ` [PATCH 0/4] btrfs-progs: check: Add repair support for mismatch dir item hash Qu Wenruo
2019-01-07  6:53   ` Qu Wenruo

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=20181025074449.32469-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).