Message ID | 20190718230617.7439-2-mcgrof@kernel.org (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | xfs: stable fixes for v4.19.y - circa ~ v4.19.58 | expand |
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index 7088f44c0c59..38ea08a3dd1d 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -1369,8 +1369,9 @@ xfs_reflink_remap_prep( goto out_unlock; /* Zap any page cache for the destination file's range. */ - truncate_inode_pages_range(&inode_out->i_data, pos_out, - PAGE_ALIGN(pos_out + *len) - 1); + truncate_inode_pages_range(&inode_out->i_data, + round_down(pos_out, PAGE_SIZE), + round_up(pos_out + *len, PAGE_SIZE) - 1); /* If we're altering the file contents... */ if (!is_dedupe) {