diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 91341ec6e06a..f1089cba913a 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4420,6 +4420,8 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) ext4_falloc_update_inode(inode, mode, new_size, (map.m_flags & EXT4_MAP_NEW)); ext4_mark_inode_dirty(handle, inode); + if ((file->f_flags & O_SYNC) && ret >= max_blocks) + ext4_handle_sync(handle); ret2 = ext4_journal_stop(handle); if (ret2) break;