• Qu Wenruo's avatar
    btrfs: backref: distinguish reloc and non-reloc use of indirect resolution · 876de781
    Qu Wenruo authored
    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: default avatarQu Wenruo <wqu@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    876de781
backref.c 82.6 KB