--- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3353,6 +3353,13 @@ static ssize_t ext4_direct_IO(struct kio size_t count = iov_iter_count(iter); ssize_t ret; + if (iov_iter_rw(iter) == READ) { + loff_t size = i_size_read(inode); + + if (offset >= size) + return 0; + } + #ifdef CONFIG_EXT4_FS_ENCRYPTION if (ext4_encrypted_inode(inode) && S_ISREG(inode->i_mode)) return 0;