ext4: fix races of writeback with punch hole and zero range
authorJan Kara <jack@suse.com>
Mon, 7 Dec 2015 19:34:49 +0000 (14:34 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 23 Mar 2016 14:20:24 +0000 (10:20 -0400)
commitf2b132595b89d9236b386e1d6ed3fcf5e9edf4cb
tree38154cb60c0c2010f6113246b89764c4d5f5ecdc
parent181aaebde9360b8235df647ee36dafdc041d4964
ext4: fix races of writeback with punch hole and zero range

When doing delayed allocation, update of on-disk inode size is postponed
until IO submission time. However hole punch or zero range fallocate
calls can end up discarding the tail page cache page and thus on-disk
inode size would never be properly updated.

Make sure the on-disk inode size is updated before truncating page
cache.

Signed-off-by: Jan Kara <jack@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Mingming Cao <mingming.cao@oracle.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/inode.c