Btrfs-progs: spit out the broken file when ignoring errors
authorJosef Bacik <jbacik@fb.com>
Fri, 31 Oct 2014 18:01:23 +0000 (14:01 -0400)
committerDavid Sterba <dsterba@suse.cz>
Fri, 14 Nov 2014 10:00:24 +0000 (11:00 +0100)
It's nice to ignore errors on restore, but spit out the filename so the user
knows which files of his aren't going to look right.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-restore.c

index 38a131e..b52d5c8 100644 (file)
@@ -840,6 +840,8 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
                        ret = copy_file(root, fd, &location, path_name);
                        close(fd);
                        if (ret) {
+                               fprintf(stderr, "Error copying data for %s\n",
+                                       path_name);
                                if (ignore_errors)
                                        goto next;
                                btrfs_free_path(path);
@@ -917,6 +919,8 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
                                         output_rootdir, dir, mreg);
                        free(dir);
                        if (ret) {
+                               fprintf(stderr, "Error searching %s\n",
+                                       path_name);
                                if (ignore_errors)
                                        goto next;
                                btrfs_free_path(path);