diff options
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 2a372a0e206f..495da2e9a8b4 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
| @@ -315,17 +315,20 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) | |||
| 315 | file = tmp->vm_file; | 315 | file = tmp->vm_file; |
| 316 | if (file) { | 316 | if (file) { |
| 317 | struct inode *inode = file->f_path.dentry->d_inode; | 317 | struct inode *inode = file->f_path.dentry->d_inode; |
| 318 | struct address_space *mapping = file->f_mapping; | ||
| 319 | |||
| 318 | get_file(file); | 320 | get_file(file); |
| 319 | if (tmp->vm_flags & VM_DENYWRITE) | 321 | if (tmp->vm_flags & VM_DENYWRITE) |
| 320 | atomic_dec(&inode->i_writecount); | 322 | atomic_dec(&inode->i_writecount); |
| 321 | 323 | spin_lock(&mapping->i_mmap_lock); | |
| 322 | /* insert tmp into the share list, just after mpnt */ | 324 | if (tmp->vm_flags & VM_SHARED) |
| 323 | spin_lock(&file->f_mapping->i_mmap_lock); | 325 | mapping->i_mmap_writable++; |
| 324 | tmp->vm_truncate_count = mpnt->vm_truncate_count; | 326 | tmp->vm_truncate_count = mpnt->vm_truncate_count; |
| 325 | flush_dcache_mmap_lock(file->f_mapping); | 327 | flush_dcache_mmap_lock(mapping); |
| 328 | /* insert tmp into the share list, just after mpnt */ | ||
| 326 | vma_prio_tree_add(tmp, mpnt); | 329 | vma_prio_tree_add(tmp, mpnt); |
| 327 | flush_dcache_mmap_unlock(file->f_mapping); | 330 | flush_dcache_mmap_unlock(mapping); |
| 328 | spin_unlock(&file->f_mapping->i_mmap_lock); | 331 | spin_unlock(&mapping->i_mmap_lock); |
| 329 | } | 332 | } |
| 330 | 333 | ||
| 331 | /* | 334 | /* |
| @@ -1398,6 +1401,7 @@ long do_fork(unsigned long clone_flags, | |||
| 1398 | init_completion(&vfork); | 1401 | init_completion(&vfork); |
| 1399 | } | 1402 | } |
| 1400 | 1403 | ||
| 1404 | audit_finish_fork(p); | ||
| 1401 | tracehook_report_clone(trace, regs, clone_flags, nr, p); | 1405 | tracehook_report_clone(trace, regs, clone_flags, nr, p); |
| 1402 | 1406 | ||
| 1403 | /* | 1407 | /* |
