From patchwork Fri Sep 29 01:37:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9976999 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 50CF560365 for ; Fri, 29 Sep 2017 01:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42FB8297AF for ; Fri, 29 Sep 2017 01:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 380BB297B1; Fri, 29 Sep 2017 01:37:25 +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,FREEMAIL_FROM, 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 BE602297AF for ; Fri, 29 Sep 2017 01:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbdI2BhX (ORCPT ); Thu, 28 Sep 2017 21:37:23 -0400 Received: from mout.gmx.net ([212.227.17.21]:53863 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbdI2BhV (ORCPT ); Thu, 28 Sep 2017 21:37:21 -0400 Received: from localhost.localdomain ([45.32.39.184]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0M4ScS-1d80bG0I2O-00yhUk; Fri, 29 Sep 2017 03:37:14 +0200 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz, nborisov@suse.com Subject: [PATCH v2 4/5] btrfs: tree-checker: Enhance output for check_csum_item Date: Fri, 29 Sep 2017 10:37:01 +0900 Message-Id: <20170929013702.17814-5-quwenruo.btrfs@gmx.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170929013702.17814-1-quwenruo.btrfs@gmx.com> References: <20170929013702.17814-1-quwenruo.btrfs@gmx.com> X-Provags-ID: V03:K0:Z80mRDnZSglJ1GXLHEHt//HOUdimfy64LP8rzadLuXOTTU4ifwi v83uBa/xLor4hzt6OgWFODvVjyFjkW7HFevQ9RPMotk/zI4n+lqXq9/BEXbnp+TRLxnewUR Aun4mdvzcO/YQrKhJhJ4s6wy9DCua/4liRjm6yaQZNln7NfgPcROfg03btvPcYU3ayOLzW1 uqtEwbI+rCfuMFUSors4A== X-UI-Out-Filterresults: notjunk:1; V01:K0:GtoiYjfh+5c=:3lRPN62XBqR0Puoo9GeQE1 W3VCtJIHqaFUJHi6s1/AROMfu2ULjli81T3XOXH1WxLvm+9sYuag56WpRUedCgS/F5CGBjpui x7smu4EGIZztVm2OW+k6A1rgA5N/cyp9UgBCl8JxGEGMqKbRoWZ45ackjcxp2DTarFwfaHkuf 4PZKY2pZAtUbFMRS5xRxAbkkwLAIVySuDZGAJF4DD4R0Xs3EekqYFd6CT5eQnd4bvalAWLaqn 5Xm7USCfxH+n5NM81v7+FJie/ajDvxxbmVcMEILyzIOgFRzOtnpMhluwW0780/cU9Oh6xwRJ/ y0P7fK4CXnNg2GTBtvArj1MFfx9cEy3Q4Y6uucGB6JWLbva9QuUqb3RrSMECY7uLPVhu/a5EC 9gc6y6zuemzVU5GQhwtsANA305sh4gItzriEmQJjOFwwqN8zY5gaw0ciC3pbPXceY8NqSObIa 4Tm/cuzk73Gnzl+3vMceBhuiei70T09w4WKtIem+MTkaDPNG0KOMEPhHdqVLuG5x3ftRfDgc0 VOjXAc6lMLtsFy8s4Mmyw16B6VJnY+3EAo1bfKBuDs7tbVwt3R3oagpGTb3IB6JMKtoGcuoL/ 7ohZ9rEVp4dXhEclUROrR7hh2WchRhb5RLZZSOENRK2RpC/4h4drV3AFysSt0Q4XjHriaJTYE 6XDYWUuquSl1Tfr1xvctIsM/cJZJTJeBJ1gFCOmzv4X73uw7v0DIZx03V1BNTB3Kon47hSZFO aVS8zEj/9+TPzelYWs2vzuHjdrRYba8tijSLto9SVNzbwXB9ace5Yj94R7MAz+x09QwVg8KIM 2Gvyfz+HI1Qip3OQB/Gyd42Js9viw== 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 Output the bad value and expected good value (or its alignment). Signed-off-by: Qu Wenruo --- fs/btrfs/tree-checker.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c index 94027f4215e9..a5b743763362 100644 --- a/fs/btrfs/tree-checker.c +++ b/fs/btrfs/tree-checker.c @@ -163,15 +163,21 @@ static int check_csum_item(struct btrfs_root *root, struct extent_buffer *leaf, u32 csumsize = btrfs_super_csum_size(root->fs_info->super_copy); if (key->objectid != BTRFS_EXTENT_CSUM_OBJECTID) { - CORRUPT("invalid objectid for csum item", leaf, root, slot); + generic_err(root, leaf, slot, + "invalid key objectid for csum item, have %llu expect %llu", + key->objectid, BTRFS_EXTENT_CSUM_OBJECTID); return -EUCLEAN; } if (!IS_ALIGNED(key->offset, sectorsize)) { - CORRUPT("unaligned key offset for csum item", leaf, root, slot); + generic_err(root, leaf, slot, + "unaligned key offset for csum item, have %llu should be aligned to %u", + key->offset, sectorsize); return -EUCLEAN; } if (!IS_ALIGNED(btrfs_item_size_nr(leaf, slot), csumsize)) { - CORRUPT("unaligned csum item size", leaf, root, slot); + generic_err(root, leaf, slot, + "unaligned item size for csum item, have %u should be aligned to %u", + btrfs_item_size_nr(leaf, slot), csumsize); return -EUCLEAN; } return 0;