On 7/9/20 10:21 PM, Matthew Wilcox (Oracle) wrote: > If we can't call page_mapping() to get the page mapping, handle the > anon/ksm/movable bits correctly. > > Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Acked-by: Vlastimil Babka <vbabka@xxxxxxx> John's updated comment looks fine too. > --- > mm/debug.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/mm/debug.c b/mm/debug.c > index 4f376514744d..e5de63406b59 100644 > --- a/mm/debug.c > +++ b/mm/debug.c > @@ -70,7 +70,12 @@ void __dump_page(struct page *page, const char *reason) > > if (page < head || (page >= head + MAX_ORDER_NR_PAGES)) { > /* Corrupt page, cannot call page_mapping */ > - mapping = page->mapping; > + unsigned long tmp = (unsigned long)page->mapping; > + > + if (tmp & PAGE_MAPPING_ANON) > + mapping = NULL; > + else > + mapping = (void *)(tmp & ~PAGE_MAPPING_FLAGS); > head = page; > compound = false; > } else { >