|
@@ -3631,6 +3631,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
|
|
if (off + len == src->i_size)
|
|
if (off + len == src->i_size)
|
|
len = ALIGN(src->i_size, bs) - off;
|
|
len = ALIGN(src->i_size, bs) - off;
|
|
|
|
|
|
|
|
+ if (len == 0) {
|
|
|
|
+ ret = 0;
|
|
|
|
+ goto out_unlock;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* verify the end result is block aligned */
|
|
/* verify the end result is block aligned */
|
|
if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) ||
|
|
if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) ||
|
|
!IS_ALIGNED(destoff, bs))
|
|
!IS_ALIGNED(destoff, bs))
|