summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-06-19 09:27:07 +0800
committerDavid Sterba <dsterba@suse.cz>2014-08-22 14:43:10 +0200
commit4cb5168ba61d87b9a9dea371c222880f68b5d6db (patch)
tree803f3a5fff2a208e723a00e4cb3604f197c2f851
parentc2059f765d4ccd03072bdbd808687b2d4298c433 (diff)
btrfs-progs: restore: output resason why it fails to read root
Previously if restore could not read users specified fs root, it would output following message: Error reading root With this patch, it will output message like: Fail to read root 1000: No such file or directory Signed-off-byr Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
-rw-r--r--cmds-restore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmds-restore.c b/cmds-restore.c
index 52c79f9f..afcb3473 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -1263,7 +1263,8 @@ int cmd_restore(int argc, char **argv)
key.offset = (u64)-1;
root = btrfs_read_fs_root(orig_root->fs_info, &key);
if (IS_ERR(root)) {
- fprintf(stderr, "Error reading root\n");
+ fprintf(stderr, "fail to read root %llu: %s\n",
+ root_objectid, strerror(-PTR_ERR(root)));
root = orig_root;
ret = 1;
goto out;