]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: backref: distinguish reloc and non-reloc use of indirect resolution
authorQu Wenruo <wqu@suse.com>
Mon, 16 Mar 2020 06:10:01 +0000 (14:10 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:22 +0000 (11:25 +0200)
commit29ffca94d508d96520b212441d76fdfcf16c40f0
treeeb237233e0737f5069edc5967a0eacd5d956b4ac
parent1a49525b51897cbfbb0e0d066dd1fd9dddbac0e5
btrfs: backref: distinguish reloc and non-reloc use of indirect resolution

For relocation tree detection, relocation backref cache uses
btrfs_should_ignore_reloc_root() which uses relocation-specific checks
like checking the DEAD_RELOC_ROOT bit.

However for general purpose backref cache, we can rely on that check, as
it's possible that relocation is also running.

For generic purposed backref cache, we detect reloc root by
SHARED_BLOCK_REF item.  Only reloc root node has its parent bytenr
pointing back to itself.

And in that case, backref cache will mark the reloc root node useless,
dropping any child orphan nodes.

So only call btrfs_should_ignore_reloc_root() if the backref cache is
for relocation.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c