Re: [PATCH v2] Btrfs: allow file data clone within a file

2013-04-15 Thread David Sterba
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 */

[PATCH v2] Btrfs: allow file data clone within a file

2013-04-14 Thread Liu Bo
We did not allow file data clone within the same file because of deadlock issues. However, we now use nested lock to avoid deadlock between the parent directory and the child file. So it's safe to do file clone within the same file when the two ranges are not overlapped. Signed-off-by: Liu Bo