diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2020-10-16 05:10:08 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-10-16 20:11:19 +0200 |
commit | 73eb7f9a4ff034d20c8f9454a5a6f45a60cf8dfc (patch) | |
tree | 5ae619c217e9dcfd5e14fafdc05388921b23f70a /kernel | |
parent | mm/workingset.c: fix some doc warnings (diff) | |
download | linux-73eb7f9a4ff034d20c8f9454a5a6f45a60cf8dfc.tar.xz linux-73eb7f9a4ff034d20c8f9454a5a6f45a60cf8dfc.zip |
mm: use helper function put_write_access()
In commit 1da177e4c3f4 ("Linux-2.6.12-rc2"), the helper put_write_access()
came with the atomic_dec operation of the i_writecount field. But it
forgot to use this helper in __vma_link_file() and dup_mmap().
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20200924115235.5111-1-linmiaohe@huawei.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 3ca8f1f83fb3..e0f74be1423c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -556,7 +556,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, get_file(file); if (tmp->vm_flags & VM_DENYWRITE) - atomic_dec(&inode->i_writecount); + put_write_access(inode); i_mmap_lock_write(mapping); if (tmp->vm_flags & VM_SHARED) mapping_allow_writable(mapping); |