Miaohe Lin <[email protected]> writes: > Use helper function mapping_allow_writable() to atomic_inc > i_mmap_writable.
Why? > Signed-off-by: Miaohe Lin <[email protected]> > --- > 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,

