From 313807d9d77f0815486c102eaf1bdaa8085fae60 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Sat, 29 Oct 2005 18:16:08 -0700 Subject: [PATCH] --- yaml --- r: 11343 b: refs/heads/master c: 7ee78232501ea9de2b6c8f10d32c9a0fee541357 h: refs/heads/master i: 11341: 9f71249c00e88f6c8293d44ea78cd3ea729661cf 11339: 150942f364720009523a64145ac2b549f561e6df 11335: e76d7ab2f67e3039bdcb4d175ebedb560c25bd8f 11327: 2324417f416b1e096492923622b0775e113e35dc v: v3 --- [refs] | 2 +- trunk/kernel/fork.c | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index c50d4df98adb..6275a6e2a740 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fd3e42fcc888a773572282575d2fdbf5cfd6216e +refs/heads/master: 7ee78232501ea9de2b6c8f10d32c9a0fee541357 diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 0e7fe4a8a8df..2a587b3224e3 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -192,6 +192,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,10 +253,7 @@ 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; @@ -275,8 +274,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;