|
@@ -3926,8 +3926,9 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
|
|
* Truncate page cache pages so that future reads will see the cloned
|
|
* Truncate page cache pages so that future reads will see the cloned
|
|
* data immediately and not the previous data.
|
|
* data immediately and not the previous data.
|
|
*/
|
|
*/
|
|
- truncate_inode_pages_range(&inode->i_data, destoff,
|
|
|
|
- PAGE_CACHE_ALIGN(destoff + len) - 1);
|
|
|
|
|
|
+ truncate_inode_pages_range(&inode->i_data,
|
|
|
|
+ round_down(destoff, PAGE_CACHE_SIZE),
|
|
|
|
+ round_up(destoff + len, PAGE_CACHE_SIZE) - 1);
|
|
out_unlock:
|
|
out_unlock:
|
|
if (!same_inode)
|
|
if (!same_inode)
|
|
btrfs_double_inode_unlock(src, inode);
|
|
btrfs_double_inode_unlock(src, inode);
|