From patchwork Fri Jul 14 07:47:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Su Yue X-Patchwork-Id: 9840091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B87860212 for ; Fri, 14 Jul 2017 07:45:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D2DF28751 for ; Fri, 14 Jul 2017 07:45:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1230B28770; Fri, 14 Jul 2017 07:45:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69AAF28751 for ; Fri, 14 Jul 2017 07:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751441AbdGNHph (ORCPT ); Fri, 14 Jul 2017 03:45:37 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:23846 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751418AbdGNHpf (ORCPT ); Fri, 14 Jul 2017 03:45:35 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="21284585" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 14 Jul 2017 15:45:33 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 7570C46B5263 for ; Fri, 14 Jul 2017 15:45:32 +0800 (CST) Received: from localhost.g08.fujitsu.local (10.167.226.129) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 14 Jul 2017 15:45:29 +0800 From: Su Yue To: Subject: [PATCH 3/3] btrfs-progs: fsck-test: case for corrupted dir item name Date: Fri, 14 Jul 2017 15:47:46 +0800 Message-ID: <20170714074746.28177-3-suy.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170714074746.28177-1-suy.fnst@cn.fujitsu.com> References: <20170714074746.28177-1-suy.fnst@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.226.129] X-yoursite-MailScanner-ID: 7570C46B5263.A71DC X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: suy.fnst@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In this test case, all name in dir_item, dir_index, inode_ref are corrupted to another one. btrfs check should report errors about the corrupted dir_item but btrfs can't repair the case now. Signed-off-by: Su Yue --- .../fsck-tests/026-bad-dir-item-name/default_case.img.xz | Bin 0 -> 1924 bytes tests/fsck-tests/026-bad-dir-item-name/test.sh | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz create mode 100755 tests/fsck-tests/026-bad-dir-item-name/test.sh diff --git a/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz b/tests/fsck-tests/026-bad-dir-item-name/default_case.img.xz new file mode 100644 index 0000000000000000000000000000000000000000..27e8553f103095170420c0e115cab4bc889c2af5 GIT binary patch literal 1924 zcmV-~2YdMaH+ooF000E$*0e?f03iVu0001VFXf})3;zd1T>wRyj;C3^v%$$4d1t#p zhBKh;(bwue6)D<_5I7>z%J5C)A&&>6?lo!ie$bd8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I=bYyFt{~9cedRRwJYji~)6QhtxUPz#uq=C~sfPjAHy0cy z)^1gsBnJqc>f=Bg9i#t5x%o@0)t)f!XAEYh6OwtUtsP@A+$@-@t=ac>*t7npx^qT9o z9xkr@9gz`7q8i^#JV{Qi07c`M(9(A?E zyTf3My;KhyMB(D$%NJC%$oE!U!3sBv?tJpvQ1i1_UXA07QS^xH6IW#d)a{mEp`)vS zDf46(oEnK601Yqd$qK1-D4Cyyf{%N%`u(f}%=E#P~`Ly*qG_NfzxGDrCS=&Q2Qg@v3;Z=#e+p)R!nYrnu~L@K z6d?=m1ZsNX$W?=u{byS+^y!aE>yhFncJubwz8*?+4HoXj{B7oKzghz%cb}#G|JRNg z_iS1_L_@Gyy7KcQlwur;Hlqa!l`K#J#sC1dx@D`5yoSO60pJdR7ytmxHBFVV#Ao{g K000001X)^)|E<>m literal 0 HcmV?d00001 diff --git a/tests/fsck-tests/026-bad-dir-item-name/test.sh b/tests/fsck-tests/026-bad-dir-item-name/test.sh new file mode 100755 index 00000000..00a550ce --- /dev/null +++ b/tests/fsck-tests/026-bad-dir-item-name/test.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# +# confirm whether btrfsck supports to check name and hash mismatch in dir_item + +source "$TOP/tests/common" + +check_prereq btrfs + +image=$(extract_image "./default_case.img.xz") + +run_mustfail "$TOP/btrfs" check "$image" + +rm -f "$image"