disable numtask controller for extended testing on alpha node
[linux-2.6.git] / mm / mmap.c
index 5fc8e01..432fd49 100644 (file)
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -766,11 +766,11 @@ void __vm_stat_account(struct mm_struct *mm, unsigned long flags,
  * The caller must hold down_write(current->mm->mmap_sem).
  */
 
-unsigned long do_mmap_pgoff(struct mm_struct *mm, struct file * file, 
-                           unsigned long addr, unsigned long len,
-                           unsigned long prot, unsigned long flags,
-                           unsigned long pgoff)
+unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
+                       unsigned long len, unsigned long prot,
+                       unsigned long flags, unsigned long pgoff)
 {
+       struct mm_struct * mm = current->mm;
        struct vm_area_struct * vma, * prev;
        struct inode *inode;
        unsigned int vm_flags;
@@ -1440,8 +1440,7 @@ int expand_stack(struct vm_area_struct * vma, unsigned long address)
        address &= PAGE_MASK;
        grow = (address - vma->vm_end) >> PAGE_SHIFT;
 
-       /* Someone beat us to it */
-       if (grow <= 0) {
+       if (address < vma->vm_end) {
                anon_vma_unlock(vma);
                return 0;
        }
@@ -1517,8 +1516,7 @@ int expand_stack(struct vm_area_struct *vma, unsigned long address)
        address &= PAGE_MASK;
        grow = (vma->vm_start - address) >> PAGE_SHIFT;
 
-       /* Someone beat us to it */
-       if (grow <= 0) {
+       if (address >= vma->vm_start) {
                anon_vma_unlock(vma);
                return 0;
        }