diff --git a/cmds/receive.c b/cmds/receive.c index e4430b077e..051eca6a2a 100644 --- a/cmds/receive.c +++ b/cmds/receive.c @@ -1285,7 +1285,7 @@ static int process_encoded_write(const char *path, const void *data, u64 offset, if (ret >= 0) return 0; /* Fall back for these errors, fail hard for anything else. */ - if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL) { + if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL && errno != EPERM) { ret = -errno; error("encoded_write: writing to %s failed: %m", path); return ret; diff --git a/cmds/subvolume-list.c b/cmds/subvolume-list.c index 21319267e2..c5f7e81c82 100644 --- a/cmds/subvolume-list.c +++ b/cmds/subvolume-list.c @@ -769,7 +769,7 @@ static int resolve_root(struct rb_root *rl, struct root_info *ri, */ static int lookup_ino_path(int fd, struct root_info *ri) { - struct btrfs_ioctl_ino_lookup_args args; + struct btrfs_ioctl_ino_lookup_user_args args; int ret; if (ri->path) @@ -780,9 +780,9 @@ static int lookup_ino_path(int fd, struct root_info *ri) memset(&args, 0, sizeof(args)); args.treeid = ri->ref_tree; - args.objectid = ri->dir_id; + args.dirid = ri->dir_id; - ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args); + ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP_USER, &args); if (ret < 0) { if (errno == ENOENT) { ri->ref_tree = 0; @@ -792,6 +792,8 @@ static int lookup_ino_path(int fd, struct root_info *ri) return ret; } + strcpy(ri->name, args.name); + if (args.name[0]) { /* * we're in a subdirectory of ref_tree, the kernel ioctl