diff --git a/fs/fuse/file.c b/fs/fuse/file.c index ac3b4e9f5668..cad73bad9c90 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1033,6 +1033,19 @@ static int fuse_readpages_fill(void *_data, struct page *page) struct inode *inode = data->inode; struct fuse_conn *fc = get_fuse_conn(inode); +#ifdef CONFIG_FUSE_BPF + /* + * Currently no meaningful readahead is possible with fuse-bpf within + * the kernel, so unless the daemon is aware of this file, ignore this + * call. + */ + if (!get_fuse_inode(inode)->nodeid) + return -EIO; +#endif + + if (fuse_is_bad(inode)) + return -EIO; + fuse_wait_on_page_writeback(inode, page->index); if (ap->num_pages &&