btrfs: backref, only collect file extent items matching backref offset
authorethanwu <ethanwu@synology.com>
Fri, 7 Feb 2020 09:38:15 +0000 (17:38 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:40 +0000 (17:01 +0100)
commit7ac8b88ee668a5b4743ebf3e9888fabac85c334a
treedfe0a48874301dcd2fb156736e050982c3f9e95f
parent9da2b242e21689514a5aaf27c8f4e7531c671543
btrfs: backref, only collect file extent items matching backref offset

When resolving one backref of type EXTENT_DATA_REF, we collect all
references that simply reference the EXTENT_ITEM even though their
(file_pos - file_extent_item::offset) are not the same as the
btrfs_extent_data_ref::offset we are searching for.

This patch adds additional check so that we only collect references whose
(file_pos - file_extent_item::offset) == btrfs_extent_data_ref::offset.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: ethanwu <ethanwu@synology.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c