Commit 050006a7 authored by Sage Weil's avatar Sage Weil Committed by Chris Mason
Browse files

Btrfs: fix clone ioctl where range is adjacent to extent

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: default avatarYehuda Sadeh <>
Signed-off-by: default avatarChris Mason <>
parent 9a019196
......@@ -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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment