diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 6d253edebf9fc4..130ed5d8373471 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -2002,6 +2002,14 @@ int ext4_convert_inline_data(struct inode *inode) if (!ext4_has_inline_data(inode)) { ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); return 0; + } else if (test_opt(inode->i_sb, DELALLOC) && !S_ISDIR(inode->i_mode)) { + error = filemap_flush(inode->i_mapping); + if (error) + return error; + if (!ext4_has_inline_data(inode)) { + ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); + return 0; + } } needed_blocks = ext4_writepage_trans_blocks(inode);