From patchwork Mon Nov 13 04:32:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10055119 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 5080D60365 for ; Mon, 13 Nov 2017 04:32:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4526C29232 for ; Mon, 13 Nov 2017 04:32:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 399EC29236; Mon, 13 Nov 2017 04:32:20 +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 BC63429232 for ; Mon, 13 Nov 2017 04:32:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751641AbdKMEcQ (ORCPT ); Sun, 12 Nov 2017 23:32:16 -0500 Received: from prv3-mh.provo.novell.com ([137.65.250.26]:54343 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbdKMEcO (ORCPT ); Sun, 12 Nov 2017 23:32:14 -0500 Received: from adam-pc.lan (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (NOT encrypted); Sun, 12 Nov 2017 21:32:07 -0700 From: Qu Wenruo To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.cz, chris@colorremedies.com Subject: [PATCH 2/3] btrfs-progs: lowmem fsck: Fix false backref lost warning for keyed extent data ref Date: Mon, 13 Nov 2017 12:32:02 +0800 Message-Id: <20171113043203.9859-2-wqu@suse.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113043203.9859-1-wqu@suse.com> References: <20171113043203.9859-1-wqu@suse.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 For keyed extent ref, its offset is calculated offset (file offset - file extent offset), just like inlined extent data ref. However the code is using file offset to hash extent data ref offset, causing false backref lost warning like: ------ ERROR: data extent[16913485824 7577600] backref lost ------ Fixes: b0d360b541f0 ("btrfs-progs: check: introduce function to check data backref in extent tree") Reported-by: Chris Murphy Signed-off-by: Qu Wenruo --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-check.c b/cmds-check.c index 0ceff5b7bbea..b9943a0d3a0f 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -10519,7 +10519,7 @@ static int check_extent_data_item(struct btrfs_root *root, dbref_key.objectid = btrfs_file_extent_disk_bytenr(eb, fi); dbref_key.type = BTRFS_EXTENT_DATA_REF_KEY; dbref_key.offset = hash_extent_data_ref(root->objectid, - fi_key.objectid, fi_key.offset); + fi_key.objectid, fi_key.offset - offset); ret = btrfs_search_slot(NULL, root->fs_info->extent_root, &dbref_key, &path, 0, 0);