From aa5f0626f8a7797278e55e9976c2e868962af8da Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 16 Apr 2013 13:13:38 -0400 Subject: 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 --- cmds-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds-check.c') 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; -- cgit v1.2.3