btrfs-progs: lowmem check: Fix inlined data extent ref lookup
authorQu Wenruo <wqu@suse.com>
Wed, 22 Nov 2017 09:03:17 +0000 (17:03 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 3 Jan 2018 16:09:11 +0000 (17:09 +0100)
commit7cf15bcc6afd6f9bbd8caf1c81b5424d1f41190a
tree8dbd4a6d4b9b85a96c41632e67efcae420f2eab6
parent702298b2d9eed782c30d85a207006731ebdfc78a
btrfs-progs: lowmem check: Fix inlined data extent ref lookup

When lowmem fsck tries to find backref of a specified file extent, it
searches inlined data ref first.

However, extent data ref contains both owner root objectid, inode number
and calculated offset (file offset - extent offset).

The code only checks owner root objectid, not checking inode number nor
calculated offset.

This makes lowmem mode fail to detect any backref mismatch if there is
a inlined data ref with the same owner objectid.

Fix it by also checking extent data ref's objectid and offset.

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>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c