]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/memory.c
Revert "UBUNTU: SAUCE: mm: Only expand stack if guard area is hit"
[mirror_ubuntu-zesty-kernel.git] / mm / memory.c
index ad7fa9be2fa0cb8c29ea9a3aba613cc51261811d..fca9dc75a04d3f01d3e012ae808fc8525d7f64fd 100644 (file)
@@ -2733,10 +2733,9 @@ static int do_anonymous_page(struct vm_fault *vmf)
                return VM_FAULT_SIGBUS;
 
        /* Check if we need to add a guard page to the stack */
-       if (stack_guard_area(vma, vmf->address)) {
-               if (expand_stack(vma, vmf->address) < 0)
-                       return VM_FAULT_SIGSEGV;
-       }
+       if ((vma->vm_flags & (VM_GROWSDOWN|VM_GROWSUP)) &&
+                       expand_stack(vma, vmf->address) < 0)
+               return VM_FAULT_SIGSEGV;
 
        /*
         * Use pte_alloc() instead of pte_alloc_map().  We can't run