btrfs-progs: reset the ret value when ignoring an error from du_add_file

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>
This commit is contained in:
Goffredo Baroncelli 2017-08-18 09:04:20 +02:00 committed by David Sterba
parent a36d92cb8b
commit 02d04d8b23
1 changed files with 1 additions and 0 deletions

View 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,