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

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 <yehuda@hq.newdream.net>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
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;
......
Markdown is supported
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