Skip to content

Commit

Permalink
Btrfs: fix clone ioctl where range is adjacent to extent
Browse files Browse the repository at this point in the history
We had an edge case issue where the requested range was just
following an existing extent. Instead of skipping to the next
extent, we used the previous one which lead to having zero
sized extents.

Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Sage Weil authored and Chris Mason committed Oct 29, 2010
1 parent 9a01919 commit 050006a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
}
btrfs_release_path(root, path);

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

Expand Down

0 comments on commit 050006a

Please sign in to comment.