On Mon, Feb 06, 2023 at 05:04:07PM -0800, Andrew Morton wrote: > +struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, > + pgoff_t index, gfp_t gfp) > +{ > + struct folio *folio = shmem_read_folio_gfp(mapping, index, gfp); > + struct page *page = folio_file_page(folio, index); > + Ugh, insufficiently cautious. This should have been struct folio *folio = shmem_read_folio_gfp(mapping, index, gfp); struct page *page; if (IS_ERR(folio)) return &folio->page; page = folio_file_page(folio, index); Unfortunately I have to go out now, but that's the solution to the latest syzbot splat I saw. I'll do you a proper -fix patch later if you don't get to it first. > if (PageHWPoison(page)) { > folio_put(folio); > return ERR_PTR(-EIO); > } > > return page; > -#else > - /* > - * The tiny !SHMEM case uses ramfs without swap > - */ > - return read_cache_page_gfp(mapping, index, gfp); > -#endif > } > EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp); > _ > > Patches currently in -mm which might be from willy@xxxxxxxxxxxxx are > > mm-add-memcpy_from_file_folio.patch > filemap-add-mapping_read_folio_gfp.patch > shmem-add-shmem_read_folio-and-shmem_read_folio_gfp.patch > shmem-fix-w=1-build-warnings-with-config_shmem=n.patch >