summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorJan Kara2015-12-07 20:34:49 +0100
committerTheodore Ts'o2015-12-07 20:34:49 +0100
commit011278485ecc3cd2a3954b5d4c73101d919bf1fa (patch)
tree740938e00aa0c972db386b5576656e646c02e36d /fs/ext4/ext4.h
parentext4: fix races between buffered IO and collapse / insert range (diff)
downloadkernel-qcow2-linux-011278485ecc3cd2a3954b5d4c73101d919bf1fa.tar.gz
kernel-qcow2-linux-011278485ecc3cd2a3954b5d4c73101d919bf1fa.tar.xz
kernel-qcow2-linux-011278485ecc3cd2a3954b5d4c73101d919bf1fa.zip
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 348a5ff4a0e2..80f76f092079 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;