[Devel] [RH7 PATCH] ext4: drop pfcache csum on fallocate
Dmitry Monakhov
dmonakhov at openvz.org
Tue Sep 29 03:37:19 PDT 2015
Dmitry Monakhov <dmonakhov at openvz.org> writes:
Please ignore this patch, use second version instead
> If fallocate will change file's data we have to drop csum.
>
> Signed-off-by: Dmitry Monakhov <dmonakhov at openvz.org>
> ---
> fs/ext4/extents.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 08b0709..fe95102 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -5062,6 +5062,11 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
> FALLOC_FL_CONVERT_AND_EXTEND))
> return -EOPNOTSUPP;
>
> + /* If data is about to change we must drop csum */
> + if (ext4_test_inode_state(inode, EXT4_STATE_CSUM) &&
> + ((mode & ~FALLOC_FL_KEEP_SIZE) || !(mode & FALLOC_FL_KEEP_SIZE)))
> + ext4_truncate_data_csum(inode, -1);
> +
> if (mode & FALLOC_FL_PUNCH_HOLE)
> return ext4_punch_hole(inode, offset, len);
>
> --
> 1.7.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20150929/6d32ac14/attachment-0001.sig>
More information about the Devel
mailing list