diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 69360b08db73..35c72f8fee75 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1425,7 +1425,8 @@ static int ext4_write_end(struct file *file, int inline_data = ext4_has_inline_data(inode); trace_ext4_write_end(inode, pos, len, copied); - if (inline_data) { + if (inline_data && + ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) { ret = ext4_write_inline_data_end(inode, pos, len, copied, page); if (ret < 0) {