From: ebiederm@xmission.com (Eric W. Biederman)
To: Miaohe Lin <linmiaohe@huawei.com>
Cc: <christian.brauner@ubuntu.com>, <akpm@linux-foundation.org>,
<peterz@infradead.org>, <mingo@kernel.org>,
<christian@kellner.me>, <surenb@google.com>, <areber@redhat.com>,
<shakeelb@google.com>, <cyphar@cyphar.com>, <tglx@linutronix.de>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fork: Use helper function mapping_allow_writable() in dup_mmap()
Date: Sun, 13 Sep 2020 11:18:55 -0500 [thread overview]
Message-ID: <87r1r5wsy8.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20200913092415.24408-1-linmiaohe@huawei.com> (Miaohe Lin's message of "Sun, 13 Sep 2020 05:24:15 -0400")
Miaohe Lin <linmiaohe@huawei.com> writes:
> Use helper function mapping_allow_writable() to atomic_inc
> i_mmap_writable.
Why?
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> 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,
next prev parent reply other threads:[~2020-09-13 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-13 9:24 Miaohe Lin
2020-09-13 16:18 ` Eric W. Biederman [this message]
2020-09-15 15:47 ` Christian Brauner
2020-09-14 1:38 linmiaohe
2020-09-14 12:03 ` Eric W. Biederman
2020-09-15 9:25 linmiaohe
2020-09-16 1:39 linmiaohe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r1r5wsy8.fsf@x220.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=areber@redhat.com \
--cc=christian.brauner@ubuntu.com \
--cc=christian@kellner.me \
--cc=cyphar@cyphar.com \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=shakeelb@google.com \
--cc=surenb@google.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®