ChangeSet 1.2231.1.89, 2005/03/28 19:41:15-08:00, [EMAIL PROTECTED]

        [PATCH] x86_64: hugetlb fix
        
        x86-64 may have to allocate a bunch of upper levels of pagetables, and 
those
        allocations may fail.  When they do, unmap_hugepage_range() needs to be 
able
        to clean up after them.
        
        Acked-by: William Lee Irwin III <[EMAIL PROTECTED]>
        Cc: Andi Kleen <[EMAIL PROTECTED]>
        Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
        Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>



 hugetlbpage.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


diff -Nru a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c
--- a/arch/i386/mm/hugetlbpage.c        2005-03-28 21:26:05 -08:00
+++ b/arch/i386/mm/hugetlbpage.c        2005-03-28 21:26:05 -08:00
@@ -209,14 +209,17 @@
 {
        struct mm_struct *mm = vma->vm_mm;
        unsigned long address;
-       pte_t pte;
+       pte_t pte, *ptep;
        struct page *page;
 
        BUG_ON(start & (HPAGE_SIZE - 1));
        BUG_ON(end & (HPAGE_SIZE - 1));
 
        for (address = start; address < end; address += HPAGE_SIZE) {
-               pte = ptep_get_and_clear(mm, address, huge_pte_offset(mm, 
address));
+               ptep = huge_pte_offset(mm, address);
+               if (!ptep)
+                       continue;
+               pte = ptep_get_and_clear(mm, address, ptep);
                if (pte_none(pte))
                        continue;
                page = pte_page(pte);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to