diff --git a/mm/filemap.c b/mm/filemap.c index 4f3753f0a158..242d01d20910 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3774,7 +3774,9 @@ static struct folio *do_read_cache_folio(struct address_space *mapping, { struct folio *folio; int err; - + + if (!filler && (!mapping->a_ops || !mapping->a_ops->read_folio)) + return ERR_PTR(-EINVAL); if (!filler) filler = mapping->a_ops->read_folio; repeat: