btrfs-progs: Use more loose open ctree flags for dump-tree and restore
authorQu Wenruo <wqu@suse.com>
Wed, 11 Apr 2018 07:58:01 +0000 (15:58 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 24 Apr 2018 11:00:12 +0000 (13:00 +0200)
commitf9c56d3489c60f0bedf5b86ead01bf471e9411d6
treebd71b0fcab9cd69fad2685e18b49eba846864ee5
parentc57ed6ca6b1b0655bba4fff97ad10e32dba4a81d
btrfs-progs: Use more loose open ctree flags for dump-tree and restore

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: Christoph Anton Mitterer <calestyo@scientia.net>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-inspect-dump-tree.c
cmds-restore.c