* [PATCH v2] mm: mmap: Use helper function allow_write_access() in __remove_shared_vm_struct()
@ 2020-09-21 11:58 Miaohe Lin
0 siblings, 0 replies; only message in thread
From: Miaohe Lin @ 2020-09-21 11:58 UTC (permalink / raw)
To: akpm; +Cc: linux-mm, linux-kernel, linmiaohe
In commit 1da177e4c3f4 ("Linux-2.6.12-rc2"), the helper allow_write_access
came with the atomic_inc operation of the i_writecount field in the func
__remove_shared_vm_struct(). But it forgot to use this helper function.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index f55e7d7764a0..809b55b6f1c3 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-21 11:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21 11:58 [PATCH v2] mm: mmap: Use helper function allow_write_access() in __remove_shared_vm_struct() Miaohe Lin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox