mm: mask bits from pmd in pmd_lockptr/pmd_huge_pte
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 13 Feb 2014 12:53:33 +0000 (13:53 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 21 Feb 2014 07:50:21 +0000 (08:50 +0100)
commit634391ace193d00c59a691e9fc227b0f8942bad7
treea78cb951b8cad9a3ea503677e6681c3b3f94d8b6
parentdb85eaeb52637eb91a7bbc70f6684f5563b983e9
mm: mask bits from pmd in pmd_lockptr/pmd_huge_pte

The pmd pointer passed to pmd_lockptr/pmd_huge_pte can point to any
entry in a pmd table. With USE_SPLIT_PMD_PTLOCKS==1 the code uses
virt_to_page to get a struct page for the pmd table. The virt_to_page
function automatically masks the lower PAGE_SHIFT bits from the
address. But if the size of a pmd table is larger than PAGE_SIZE the
additional bits are not removed from the pmd address and the wrong
page struct is used.

Fix this by explicitely masking the offset in the pmd table from
the pmd pointer.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
include/linux/mm.h