diff --git a/mm/filemap.c b/mm/filemap.c index 4f3753f0a158..22df828db941 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -3775,6 +3775,8 @@ 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(-ENOTSUP); if (!filler) filler = mapping->a_ops->read_folio; repeat: