summaryrefslogtreecommitdiff
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorJan Kara <jack@suse.com>2015-12-07 19:34:49 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2015-12-07 19:34:49 (GMT)
commit011278485ecc3cd2a3954b5d4c73101d919bf1fa (patch)
tree740938e00aa0c972db386b5576656e646c02e36d /fs/ext4/ext4.h
parent32ebffd3bbb4162da5ff88f9a35dd32d0a28ea70 (diff)
downloadlinux-011278485ecc3cd2a3954b5d4c73101d919bf1fa.tar.xz
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>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 348a5ff..80f76f0 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2858,6 +2858,9 @@ static inline int ext4_update_inode_size(struct inode *inode, loff_t newsize)
return changed;
}
+int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
+ loff_t len);
+
struct ext4_group_info {
unsigned long bb_state;
struct rb_root bb_free_root;