Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223073
b: refs/heads/master
c: 75eaa0e
h: refs/heads/master
i:
  223071: 938ce5d
v: v3
  • Loading branch information
Sage Weil authored and Chris Mason committed Dec 10, 2010
1 parent ee46ef9 commit 25d4928
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24ae63656a165c870c0d69fcc8aac1dc35e25e34
refs/heads/master: 75eaa0e22c055e38982df267d0f84cc510ba38bf
20 changes: 11 additions & 9 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,23 +964,25 @@ static noinline int btrfs_ioctl_snap_create(struct file *file,
name = async_vol_args->name;
fd = async_vol_args->fd;
async_vol_args->name[BTRFS_SNAPSHOT_NAME_MAX] = '\0';

ret = btrfs_ioctl_snap_create_transid(file, name, fd,
subvol, &transid);

if (ret == 0 &&
copy_to_user(arg +
offsetof(struct btrfs_ioctl_async_vol_args,
transid), &transid, sizeof(transid)))
ret = -EFAULT;
} else {
vol_args = memdup_user(arg, sizeof(*vol_args));
if (IS_ERR(vol_args))
return PTR_ERR(vol_args);
name = vol_args->name;
fd = vol_args->fd;
vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
}

ret = btrfs_ioctl_snap_create_transid(file, name, fd,
subvol, &transid);

if (!ret && async) {
if (copy_to_user(arg +
offsetof(struct btrfs_ioctl_async_vol_args,
transid), &transid, sizeof(transid)))
return -EFAULT;
ret = btrfs_ioctl_snap_create_transid(file, name, fd,
subvol, NULL);
}

kfree(vol_args);
Expand Down

0 comments on commit 25d4928

Please sign in to comment.