diff options
-rw-r--r-- | cmds-fi-du.c | 8 | ||||
-rw-r--r-- | cmds-inspect.c | 2 | ||||
-rw-r--r-- | utils.c | 8 |
3 files changed, 12 insertions, 6 deletions
diff --git a/cmds-fi-du.c b/cmds-fi-du.c index 12855a5..6d5bf35 100644 --- a/cmds-fi-du.c +++ b/cmds-fi-du.c @@ -389,8 +389,14 @@ static int du_walk_dir(struct du_dir_ctxt *ctxt, struct rb_root *shared_extents) dirfd(dirstream), shared_extents, &tot, &shr, 0); - if (ret) + if (ret == -ENOTTY) { + continue; + } else if (ret) { + fprintf(stderr, + "failed to walk dir/file: %s :%s\n", + entry->d_name, strerror(-ret)); break; + } ctxt->bytes_total += tot; ctxt->bytes_shared += shr; diff --git a/cmds-inspect.c b/cmds-inspect.c index dd7b9dd..2ae44be 100644 --- a/cmds-inspect.c +++ b/cmds-inspect.c @@ -323,7 +323,7 @@ static int cmd_inspect_rootid(int argc, char **argv) ret = lookup_ino_rootid(fd, &rootid); if (ret) { - error("rootid failed with ret=%d", ret); + error("failed to lookup root id: %s", strerror(-ret)); goto out; } @@ -2815,6 +2815,8 @@ path: if (fd < 0) goto err; ret = lookup_ino_rootid(fd, &id); + if (ret) + error("failed to lookup root id: %s", strerror(-ret)); close(fd); if (ret < 0) goto err; @@ -3497,10 +3499,8 @@ int lookup_ino_rootid(int fd, u64 *rootid) args.objectid = BTRFS_FIRST_FREE_OBJECTID; ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args); - if (ret < 0) { - error("failed to lookup root id: %s", strerror(errno)); - return ret; - } + if (ret < 0) + return -errno; *rootid = args.treeid; |