From patchwork Tue Feb 27 10:02:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lu Fengqi X-Patchwork-Id: 10244613 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 9869E60208 for ; Tue, 27 Feb 2018 10:03:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86ED92A31E for ; Tue, 27 Feb 2018 10:03:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B5102A53A; Tue, 27 Feb 2018 10:03:12 +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 013E62A31E for ; Tue, 27 Feb 2018 10:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752575AbeB0KDI (ORCPT ); Tue, 27 Feb 2018 05:03:08 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:1684 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752390AbeB0KDH (ORCPT ); Tue, 27 Feb 2018 05:03:07 -0500 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="37293990" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Feb 2018 18:03:04 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id D5B8848AE761 for ; Tue, 27 Feb 2018 18:03:04 +0800 (CST) Received: from fnst.lan (10.167.226.155) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 27 Feb 2018 18:03:08 +0800 From: Lu Fengqi To: Subject: [PATCH] btrfs-progs: check/lowmem: Fix the incorrect error message of check_extent_data_item Date: Tue, 27 Feb 2018 18:02:57 +0800 Message-ID: <20180227100257.6774-1-lufq.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.16.2 MIME-Version: 1.0 X-Originating-IP: [10.167.226.155] X-yoursite-MailScanner-ID: D5B8848AE761.ACE8D X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lufq.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 Instead of the disk_bytenr and disk_num_bytes of the extent_item which the file extent references, we should output the objectid and offset of the file extent. Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Signed-off-by: Lu Fengqi --- check/mode-lowmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index 62bcf3d2e126..07863a9312ce 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -2631,9 +2631,8 @@ static int check_extent_data_item(struct btrfs_root *root, if (!(extent_flags & BTRFS_EXTENT_FLAG_DATA)) { error( - "extent[%llu %llu] backref type mismatch, wanted bit: %llx", - disk_bytenr, disk_num_bytes, - BTRFS_EXTENT_FLAG_DATA); + "file extent[%llu %llu] backref type mismatch, wanted bit: %llx", + fi_key.objectid, fi_key.offset, BTRFS_EXTENT_FLAG_DATA); err |= BACKREF_MISMATCH; } @@ -2722,8 +2721,8 @@ out: err |= BACKREF_MISSING; btrfs_release_path(&path); if (err & BACKREF_MISSING) { - error("data extent[%llu %llu] backref lost", - disk_bytenr, disk_num_bytes); + error("file extent[%llu %llu] backref lost", + fi_key.objectid, fi_key.offset); } return err; }