Revert "mm: fix page table unmap for stack guard page properly"

This reverts commit 1cb5bb4cb2.
This commit is contained in:
Matt Sealey
2010-08-28 16:03:17 -05:00
parent 3ca9918a7e
commit 731ff96439

View File

@@ -2644,23 +2644,24 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
spinlock_t *ptl;
pte_t entry;
pte_unmap(page_table);
/* Check if we need to add a guard page to the stack */
if (check_stack_guard_page(vma, address) < 0)
if (check_stack_guard_page(vma, address) < 0) {
pte_unmap(page_table);
return VM_FAULT_SIGBUS;
}
/* Use the zero-page for reads */
if (!(flags & FAULT_FLAG_WRITE)) {
entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
vma->vm_page_prot));
page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
ptl = pte_lockptr(mm, pmd);
spin_lock(ptl);
if (!pte_none(*page_table))
goto unlock;
goto setpte;
}
/* Allocate our own private page. */
pte_unmap(page_table);
if (unlikely(anon_vma_prepare(vma)))
goto oom;
page = alloc_zeroed_user_highpage_movable(vma, address);