[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200913092838.27724-1-linmiaohe@huawei.com>
Date: Sun, 13 Sep 2020 05:28:38 -0400
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] mm: mmap: Use helper function allow_write_access() in __remove_shared_vm_struct()
Use helper function allow_write_access() to atomic_inc the i_writecount.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 80ea11bf12fa..a22f1a2fc82e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -143,7 +143,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
struct file *file, struct address_space *mapping)
{
if (vma->vm_flags & VM_DENYWRITE)
- atomic_inc(&file_inode(file)->i_writecount);
+ allow_write_access(file);
if (vma->vm_flags & VM_SHARED)
mapping_unmap_writable(mapping);
--
2.19.1
Powered by blists - more mailing lists