On Mon, Apr 15, 2013 at 10:55:45AM +0800, Liu Bo wrote:
> @@ -2563,6 +2568,12 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
> !IS_ALIGNED(destoff, bs))
> goto out_unlock;
>
> + /* verify if ranges are overlapped within the same file */
> + if (same_inode) {
> + if (destoff + len > off && destoff < off + len)
> + goto out_unlock;
Although I find the condition hard to read, it's correct.
Reviewed-by: David Sterba <dsterba@xxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html