pagemap-cache: stop filling cache on VMA_AREA_GUARD

VMA_AREA_GUARD areas are added to the end of the vma_area_list and
are not necessarily sorted by address. pmc_fill_cache() expects
VMAs to be sorted and triggers BUG_ON() if it meets a VMA with
a lower address than the current cache window.

Since guard VMAs don't have pagemap entries and are skipped during
dump, just stop the lookahead loop when we encounter one.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Andrei Vagin 2026-03-04 08:06:08 +00:00 committed by Alexander Mikhalitsyn
parent 649569daf0
commit cf66ae00f4
No known key found for this signature in database
GPG key ID: B1F47F5CB05B4FA3

View file

@ -137,6 +137,9 @@ static int pmc_fill_cache(pmc_t *pmc, const struct vma_area *vma)
nr_vmas, size_cov);
list_for_each_entry_continue(vma, pmc->vma_head, list) {
if (vma_area_is(vma, VMA_AREA_GUARD))
break;
if (vma->e->start > high || vma->e->end > high)
break;