From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Markus Elfring <Markus.Elfring@web.de>,
Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <songmuchun@bytedance.com>,
Xiongchun Duan <duanxiongchun@bytedance.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
David Hildenbrand <david@redhat.com>,
Yang Shi <yang.shi@linux.alibaba.com>
Subject: Re: [PATCH v4] mm/ksm: Fix NULL pointer dereference when KSM zero page is enabled
Date: Thu, 16 Apr 2020 14:20:24 +0300 [thread overview]
Message-ID: <e620f913-d0fb-7d48-b6b2-d4c6b433b563@virtuozzo.com> (raw)
In-Reply-To: <516df5d7-b514-11dc-130e-f1a2edce0108@web.de>
On 16.04.2020 09:14, Markus Elfring wrote:
> …
>>> +++ b/mm/ksm.c
>>> @@ -2112,8 +2112,15 @@ static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)
> …
>>> + if (vma)
>>> + err = try_to_merge_one_page(vma, page,
>>> + ZERO_PAGE(rmap_item->address));
>>> + else
>>> + /**
>>> + * If the vma is out of date, we do not need to
>>> + * continue.
>>> + */
>>> + err = 0;
>>> up_read(&mm->mmap_sem);
> …
>> It's conventional to put braces around multi-line blocks such as this.
>
> Are there different views to consider around the usage of single statements
> together with curly brackets in if branches?
For me Andrew's conversion is the best readable. I try to comment the code
the same way myself. I even thought it's kernel default style :)
Kirill
next prev parent reply other threads:[~2020-04-16 11:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 2:50 [PATCH v4] mm/ksm: Fix NULL pointer dereference when KSM zero page is enabled Muchun Song
2020-04-16 2:58 ` Andrew Morton
2020-04-16 6:14 ` Markus Elfring
2020-04-16 11:20 ` Kirill Tkhai [this message]
2020-04-16 20:05 ` Joe Perches
2020-04-16 6:00 ` Markus Elfring
2020-04-16 11:21 ` Matthew Wilcox
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=e620f913-d0fb-7d48-b6b2-d4c6b433b563@virtuozzo.com \
--to=ktkhai@virtuozzo.com \
--cc=Markus.Elfring@web.de \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=duanxiongchun@bytedance.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=songmuchun@bytedance.com \
--cc=yang.shi@linux.alibaba.com \
/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;
as well as URLs for NNTP newsgroup(s).