Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some user-permission changes to btrfs-progs #762

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmds/receive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 5 additions & 3 deletions cmds/subvolume-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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
Expand Down