On Mon, Nov 10, 2025 at 7:37 PM Kairui Song ryncsn@gmail.com wrote:
diff --git a/mm/swap_state.c b/mm/swap_state.c index 3f85a1c4cfd9..4cca4865627f 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c @@ -747,6 +747,7 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask,
blk_start_plug(&plug); for (addr = start; addr < end; ilx++, addr += PAGE_SIZE) {
struct swap_info_struct *si = NULL; leaf_entry_t entry; if (!pte++) {@@ -761,8 +762,12 @@ static struct folio *swap_vma_readahead(swp_entry_t targ_entry, gfp_t gfp_mask, continue; pte_unmap(pte); pte = NULL;
if (swp_type(entry) != swp_type(targ_entry))si = get_swap_device(entry);
Oops I missed a NULL check here.
folio = __read_swap_cache_async(entry, gfp_mask, mpol, ilx, &page_allocated, false);
if (si)put_swap_device(si); if (!folio) continue; if (page_allocated) {I'll post a patch if it looks ok.