Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332582
b: refs/heads/master
c: aa42ffd
h: refs/heads/master
v: v3
  • Loading branch information
Liu Bo authored and Chris Mason committed Oct 9, 2012
1 parent e400332 commit ed2d196
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 7e97b8daf63487c20f78487bd4045f39b0d97cf4
refs/heads/master: aa42ffd918c420d5625b25b7a0bc2bbde4c9f890
18 changes: 9 additions & 9 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2481,13 +2481,13 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
another, and lock file content */
while (1) {
struct btrfs_ordered_extent *ordered;
lock_extent(&BTRFS_I(src)->io_tree, off, off+len);
ordered = btrfs_lookup_first_ordered_extent(src, off+len);
lock_extent(&BTRFS_I(src)->io_tree, off, off + len - 1);
ordered = btrfs_lookup_first_ordered_extent(src, off + len - 1);
if (!ordered &&
!test_range_bit(&BTRFS_I(src)->io_tree, off, off+len,
EXTENT_DELALLOC, 0, NULL))
!test_range_bit(&BTRFS_I(src)->io_tree, off, off + len - 1,
EXTENT_DELALLOC, 0, NULL))
break;
unlock_extent(&BTRFS_I(src)->io_tree, off, off+len);
unlock_extent(&BTRFS_I(src)->io_tree, off, off + len - 1);
if (ordered)
btrfs_put_ordered_extent(ordered);
btrfs_wait_ordered_range(src, off, len);
Expand Down Expand Up @@ -2561,7 +2561,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
btrfs_release_path(path);

if (key.offset + datal <= off ||
key.offset >= off+len)
key.offset >= off + len - 1)
goto next;

memcpy(&new_key, &key, sizeof(new_key));
Expand Down Expand Up @@ -2662,8 +2662,8 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
new_key.offset += skip;
}

if (key.offset + datal > off+len)
trim = key.offset + datal - (off+len);
if (key.offset + datal > off + len)
trim = key.offset + datal - (off + len);

if (comp && (skip || trim)) {
ret = -EINVAL;
Expand Down Expand Up @@ -2740,7 +2740,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
ret = 0;
out:
btrfs_release_path(path);
unlock_extent(&BTRFS_I(src)->io_tree, off, off+len);
unlock_extent(&BTRFS_I(src)->io_tree, off, off + len - 1);
out_unlock:
mutex_unlock(&src->i_mutex);
mutex_unlock(&inode->i_mutex);
Expand Down

0 comments on commit ed2d196

Please sign in to comment.