aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/mm
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2005-09-03 18:55:01 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:05:46 -0400
commit02b0ccef903e85673ead74ddb7c431f2f7ce183d (patch)
treed359d49ef24f94a413e7dec69821645b42813921 /arch/i386/mm
parent7bf07f3d4b4358aa6d99a26d7a0165f1e91c3fcc (diff)
[PATCH] hugetlb: check p?d_present in huge_pte_offset()
For demand faulting, we cannot assume that the page tables will be populated. Do what the rest of the architectures do and test p?d_present() while walking down the page table. Signed-off-by: Adam Litke <agl@us.ibm.com> Cc: <linux-mm@kvack.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/i386/mm')
-rw-r--r--arch/i386/mm/hugetlbpage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
index 57c486f0e896..24c8a536b588 100644
--- a/arch/i386/mm/hugetlbpage.c
+++ b/arch/i386/mm/hugetlbpage.c
@@ -46,8 +46,11 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
46 pmd_t *pmd = NULL; 46 pmd_t *pmd = NULL;
47 47
48 pgd = pgd_offset(mm, addr); 48 pgd = pgd_offset(mm, addr);
49 pud = pud_offset(pgd, addr); 49 if (pgd_present(*pgd)) {
50 pmd = pmd_offset(pud, addr); 50 pud = pud_offset(pgd, addr);
51 if (pud_present(*pud))
52 pmd = pmd_offset(pud, addr);
53 }
51 return (pte_t *) pmd; 54 return (pte_t *) pmd;
52} 55}
53 56