Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86: stricter check in follow_huge_addr()

The first page of the compound page is determined in follow_huge_addr()
but then PageCompound() only checks if the page is part of a compound page.
PageHead() allows checking if this is indeed the first page of the
compound.

Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Christoph Lameter and committed by
Ingo Molnar
25e59881 b2ef7497

+1 -1
+1 -1
arch/x86/mm/hugetlbpage.c
··· 178 178 179 179 page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; 180 180 181 - WARN_ON(!PageCompound(page)); 181 + WARN_ON(!PageHead(page)); 182 182 183 183 return page; 184 184 }