btrfs-progs: reset the ret value when ignoring an error from du_add_file
authorGoffredo Baroncelli <kreijack@inwind.it>
Fri, 18 Aug 2017 07:04:20 +0000 (09:04 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
In du_walk_dir(), when du_add_file() returns an error it is usually
ignored. However if the error is returned querying the last item, the
error is returned to the caller.

Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-du.c

index f106f45..4bf6af3 100644 (file)
@@ -403,6 +403,7 @@ static int du_walk_dir(struct du_dir_ctxt *ctxt, struct rb_root *shared_extents)
                                                  shared_extents, &tot, &shr,
                                                  0);
                                if (ret == -ENOTTY) {
+                                       ret = 0;
                                        continue;
                                } else if (ret) {
                                        fprintf(stderr,