提交 cb48841f 编写于 作者: M Miaohe Lin 提交者: Linus Torvalds

mm/mmap.c: use helper function allow_write_access() in __remove_shared_vm_struct()

In commit 1da177e4 ("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: NMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20200921115814.39680-1-linmiaohe@huawei.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 cf508b58
...@@ -143,7 +143,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma, ...@@ -143,7 +143,7 @@ static void __remove_shared_vm_struct(struct vm_area_struct *vma,
struct file *file, struct address_space *mapping) struct file *file, struct address_space *mapping)
{ {
if (vma->vm_flags & VM_DENYWRITE) if (vma->vm_flags & VM_DENYWRITE)
atomic_inc(&file_inode(file)->i_writecount); allow_write_access(file);
if (vma->vm_flags & VM_SHARED) if (vma->vm_flags & VM_SHARED)
mapping_unmap_writable(mapping); mapping_unmap_writable(mapping);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册