[PATCH] ipmi: watchdog parms in sysfs
[safe/jmp/linux-2.6] / kernel / fork.c
index 0e7fe4a..efac2c5 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/profile.h>
 #include <linux/rmap.h>
 #include <linux/acct.h>
+#include <linux/cn_proc.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -192,6 +193,8 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 
        down_write(&oldmm->mmap_sem);
        flush_cache_mm(oldmm);
+       down_write(&mm->mmap_sem);
+
        mm->locked_vm = 0;
        mm->mmap = NULL;
        mm->mmap_cache = NULL;
@@ -251,12 +254,8 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                }
 
                /*
-                * Link in the new vma and copy the page table entries:
-                * link in first so that swapoff can see swap entries.
-                * Note that, exceptionally, here the vma is inserted
-                * without holding mm->mmap_sem.
+                * Link in the new vma and copy the page table entries.
                 */
-               spin_lock(&mm->page_table_lock);
                *pprev = tmp;
                pprev = &tmp->vm_next;
 
@@ -266,7 +265,6 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
 
                mm->map_count++;
                retval = copy_page_range(mm, oldmm, tmp);
-               spin_unlock(&mm->page_table_lock);
 
                if (tmp->vm_ops && tmp->vm_ops->open)
                        tmp->vm_ops->open(tmp);
@@ -275,8 +273,8 @@ static inline int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
                        goto out;
        }
        retval = 0;
-
 out:
+       up_write(&mm->mmap_sem);
        flush_tlb_mm(oldmm);
        up_write(&oldmm->mmap_sem);
        return retval;
@@ -1146,6 +1144,7 @@ static task_t *copy_process(unsigned long clone_flags,
                        __get_cpu_var(process_counts)++;
        }
 
+       proc_fork_connector(p);
        if (!current->signal->tty && p->signal->tty)
                p->signal->tty = NULL;