Skip to content
  • Qu Wenruo's avatar
    btrfs-progs: Use more loose open ctree flags for dump-tree and restore · f9c56d34
    Qu Wenruo authored
    
    
    Corrupted extent tree (either the root node or leaf) can normally block
    us from open the fs.
    As normally open_ctree() has the following call chain:
    __open_ctree_fd()
    |- btrfs_setup_all_roots()
       |- btrfs_read_block_groups()
          And we will search block group items in extent tree.
    
    And considering how block group items are scattered around the whole
    extent tree, any error would block the fs from being mounted.
    
    Fortunately, we already have OPEN_CTREE_NO_BLOCK_GROUPS flags to disable
    block group items search, which will not only allow us to open some
    fs, but also hugely speed up open time.
    
    Currently dump-tree and btrfs-restore is ensured that they care nothing
    about block group items. So specify OPEN_CTREE_NO_BLOCK_GROUPS flag as
    default.
    
    Reported-by: default avatarChristoph Anton Mitterer <calestyo@scientia.net>
    Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    f9c56d34