lkml.org 
[lkml]   [2020]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fork: Use helper function mapping_allow_writable() in dup_mmap()
Date
Use helper function mapping_allow_writable() to atomic_inc i_mmap_writable.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
kernel/fork.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/fork.c b/kernel/fork.c
index 4b328aecabb2..a0586716e327 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -558,7 +558,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
atomic_dec(&inode->i_writecount);
i_mmap_lock_write(mapping);
if (tmp->vm_flags & VM_SHARED)
- atomic_inc(&mapping->i_mmap_writable);
+ mapping_allow_writable(mapping);
flush_dcache_mmap_lock(mapping);
/* insert tmp into the share list, just after mpnt */
vma_interval_tree_insert_after(tmp, mpnt,
--
2.19.1
\
 
 \ /
  Last update: 2020-09-13 11:26    [W:0.030 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site