We need to truncate page cache pages for the clone ioctl target range or
else we'll confuse ourselves to no end. If the old data was cached, we
used to still see it (until remount). If the page was partially updated
we used to get a mix of old and new data.
Signed-off-by: Sage Weil
---
v1->v2:
just a readability issue:
On Tue, Aug 09, 2011 at 12:00:41PM -0700, Sage Weil wrote:
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2243,6 +2243,10 @@ static noinline long btrfs_ioctl_clone(struct file
> *file, unsigned long srcfd,
> btrfs_wait_ordered_range(src, off, len);
We need to truncate page cache pages for the clone ioctl target range or
else we'll confuse ourselves to no end. If the old data was cached, we'll
still see it (until remount). If it was dirty we'll get a mix of old and
new data if the page(s) are partially updated.
Signed-off-by: Sage Weil
---