Commit Graph

1 Commits

Author SHA1 Message Date
Kazuhito Hagio
bdd3061883 makedumpfile: Fix exclusion range in find_vmemmap_pages()
Backport from the makedumpfile devel branch in upstream.

commit b461971bfac0f193a0c274c3b657d158e07d4995
Author: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Date:   Thu Aug 29 14:51:56 2019 -0400

    [PATCH] Fix exclusion range in find_vmemmap_pages()

    In the function, since pfn ranges are literally start and end, not start
    and end+1, if the struct page of endpfn is at the last in a vmemmap page,
    the vmemmap page is dropped by the following code, and not excluded.

        npfns_offset = endpfn - vmapp->rep_pfn_start;
        vmemmap_offset = npfns_offset * size_table.page;
        // round down to page boundary
        vmemmap_offset -= (vmemmap_offset % pagesize);

    We can use (endpfn+1) here to fix.

    Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>

Signed-off-by: Kazuhito Hagio <k-hagio@ab.jp.nec.com>
Acked-by: Kairui Song <kasong@redhat.com>
2019-09-20 16:37:39 +08:00