Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201054
b: refs/heads/master
c: 2ebc346
h: refs/heads/master
v: v3
  • Loading branch information
Dan Rosenberg authored and Chris Mason committed Jul 19, 2010
1 parent d9b364d commit 1a084d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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: b5384d48f4e74edec3ca1887cb65e378a72af9a1
refs/heads/master: 2ebc3464781ad24474abcbd2274e6254689853b5
4 changes: 2 additions & 2 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
*/

/* the destination must be opened for writing */
if (!(file->f_mode & FMODE_WRITE))
if (!(file->f_mode & FMODE_WRITE) || (file->f_flags & O_APPEND))
return -EINVAL;

ret = mnt_want_write(file->f_path.mnt);
Expand Down Expand Up @@ -1511,7 +1511,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,

/* determine range to clone */
ret = -EINVAL;
if (off >= src->i_size || off + len > src->i_size)
if (off + len > src->i_size || off + len < off)
goto out_unlock;
if (len == 0)
olen = len = src->i_size - off;
Expand Down

0 comments on commit 1a084d5

Please sign in to comment.