aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 463d91b4dd3a..81b47bd8a55a 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1669,12 +1669,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
1669 olen = len = src->i_size - off; 1669 olen = len = src->i_size - off;
1670 /* if we extend to eof, continue to block boundary */ 1670 /* if we extend to eof, continue to block boundary */
1671 if (off + len == src->i_size) 1671 if (off + len == src->i_size)
1672 len = ((src->i_size + bs-1) & ~(bs-1)) 1672 len = ALIGN(src->i_size, bs) - off;
1673 - off;
1674 1673
1675 /* verify the end result is block aligned */ 1674 /* verify the end result is block aligned */
1676 if ((off & (bs-1)) || 1675 if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) ||
1677 ((off + len) & (bs-1))) 1676 !IS_ALIGNED(destoff, bs))
1678 goto out_unlock; 1677 goto out_unlock;
1679 1678
1680 /* do any pending delalloc/csum calc on src, one way or 1679 /* do any pending delalloc/csum calc on src, one way or