diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 32de10ef895b052ee057f2d0894155fe1bfc8b96..43076e72cd7650dd6dec004b29ca31554a2851d2 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -543,6 +543,12 @@ static ssize_t ext4_dio_write_iter(struct kiocb *iocb, struct iov_iter *from) ret = -EAGAIN; goto out; } + /* + * Make sure inline data cannot be created anymore since we are going + * to allocate blocks for DIO. We know the inode does not have any + * inline data now because ext4_dio_supported() checked for that. + */ + ext4_clear_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA); offset = iocb->ki_pos; count = ret;