diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 83c9ad3f2621..709419c98ca5 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -3926,8 +3926,9 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
3926 | * Truncate page cache pages so that future reads will see the cloned | 3926 | * Truncate page cache pages so that future reads will see the cloned |
3927 | * data immediately and not the previous data. | 3927 | * data immediately and not the previous data. |
3928 | */ | 3928 | */ |
3929 | truncate_inode_pages_range(&inode->i_data, destoff, | 3929 | truncate_inode_pages_range(&inode->i_data, |
3930 | PAGE_CACHE_ALIGN(destoff + len) - 1); | 3930 | round_down(destoff, PAGE_CACHE_SIZE), |
3931 | round_up(destoff + len, PAGE_CACHE_SIZE) - 1); | ||
3931 | out_unlock: | 3932 | out_unlock: |
3932 | if (!same_inode) | 3933 | if (!same_inode) |
3933 | btrfs_double_inode_unlock(src, inode); | 3934 | btrfs_double_inode_unlock(src, inode); |