summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-04-16 13:13:38 -0400
committerDavid Sterba <dsterba@suse.cz>2013-04-23 18:56:27 +0200
commitaa5f0626f8a7797278e55e9976c2e868962af8da (patch)
tree9c6107453dfc48f69352d39e3ff7113415454004 /cmds-check.c
parent18ce0501ce8a6bc2d66b6bf11358d284919c5d3c (diff)
Btrfs-progs: make restore deal with really broken file systems
All we need for restore to work is the chunk root, the tree root and the fs root we want to restore from. So to do this we need to make a few adjustments 1) Make open_ctree_fs_info fail completely if it can't read the chunk tree. There is no sense in continuing if we can't read the chunk tree since we won't be able to translate logical to physical blocks. 2) Use open_ctree_fs_info in restore, and if we didn't load a tree root or fs root go ahead and try to set those up manually ourselves. This is related to work I did last year on restore, but it uses the open_ctree_fs_info instead of my open coded open_ctree. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 44b19d8d..9fd53f42 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -4060,7 +4060,7 @@ int cmd_check(int argc, char **argv)
return -EBUSY;
}
- info = open_ctree_fs_info(argv[optind], bytenr, rw, 1);
+ info = open_ctree_fs_info(argv[optind], bytenr, 0, rw, 1);
if (!info) {
fprintf(stderr, "Couldn't open file system\n");
return -EIO;