Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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 <yehuda@hq.newdream.net>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 9a019196
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1597,7 +1597,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
			}
			}
			btrfs_release_path(root, path);
			btrfs_release_path(root, path);


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