From: Qu Wenruo <wqu@suse.com>
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 [thread overview]
Message-ID: <20171113043203.9859-2-wqu@suse.com> (raw)
In-Reply-To: <20171113043203.9859-1-wqu@suse.com>
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 <chris@colorremedies.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
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);
--
2.15.0
next prev parent reply other threads:[~2017-11-13 4:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 4:32 [PATCH 1/3] btrfs-progs: lowmem fsck: Fix inlined data extent ref lookup Qu Wenruo
2017-11-13 4:32 ` Qu Wenruo [this message]
2017-11-13 4:32 ` [PATCH 3/3] btrfs-progs: fsck-test: Introduce test case for false data extent backref lost 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=20171113043203.9859-2-wqu@suse.com \
--to=wqu@suse.com \
--cc=chris@colorremedies.com \
--cc=dsterba@suse.cz \
--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).