diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memory.c | 15 | ||||
-rw-r--r-- | mm/mmap.c | 3 |
2 files changed, 11 insertions, 7 deletions
diff --git a/mm/memory.c b/mm/memory.c index f0282eb8650..57309b164a5 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2396,11 +2396,9 @@ out_nomap: } /* - * This is like a special single-page "expand_downwards()", - * except we must first make sure that 'address-PAGE_SIZE' + * This is like a special single-page "expand_{down|up}wards()", + * except we must first make sure that 'address{-|+}PAGE_SIZE' * doesn't hit another vma. - * - * The "find_vma()" will do the right thing even if we wrap */ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address) { @@ -2412,6 +2410,15 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo expand_stack(vma, address); } + if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { + struct vm_area_struct *next = vma->vm_next; + + /* As VM_GROWSDOWN but s/below/above/ */ + if (next && next->vm_start == address + PAGE_SIZE) + return next->vm_flags & VM_GROWSUP ? 0 : -ENOMEM; + + expand_upwards(vma, address + PAGE_SIZE); + } return 0; } diff --git a/mm/mmap.c b/mm/mmap.c index 08a32cfabd5..17d640d33df 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1589,9 +1589,6 @@ static int acct_stack_growth(struct vm_area_struct * vma, unsigned long size, un * PA-RISC uses this for its stack; IA64 for its Register Backing Store. * vma is the last one with address > vma->vm_end. Have to extend vma. */ -#ifndef CONFIG_IA64 -static inline -#endif int expand_upwards(struct vm_area_struct *vma, unsigned long address) { int error; |