[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <E490CD805F7529488761C40FD9D26EF12AC9D039@dggemm507-mbx.china.huawei.com>
Date: Thu, 11 Jul 2019 01:32:57 +0000
From: Nixiaoming <nixiaoming@...wei.com>
To: Greg KH <gregkh@...uxfoundation.org>
CC: "adobriyan@...il.com" <adobriyan@...il.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"anna.schumaker@...app.com" <anna.schumaker@...app.com>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
"bfields@...ldses.org" <bfields@...ldses.org>,
"chuck.lever@...cle.com" <chuck.lever@...cle.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"jlayton@...nel.org" <jlayton@...nel.org>,
"luto@...nel.org" <luto@...nel.org>,
"mingo@...nel.org" <mingo@...nel.org>,
"Nadia.Derbey@...l.net" <Nadia.Derbey@...l.net>,
"paulmck@...ux.vnet.ibm.com" <paulmck@...ux.vnet.ibm.com>,
"semen.protsenko@...aro.org" <semen.protsenko@...aro.org>,
"stable@...nel.org" <stable@...nel.org>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"trond.myklebust@...merspace.com" <trond.myklebust@...merspace.com>,
"viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
"vvs@...tuozzo.com" <vvs@...tuozzo.com>,
"Huangjianhui (Alex)" <alex.huangjianhui@...wei.com>,
Dailei <dylix.dailei@...wei.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-nfs@...r.kernel.org" <linux-nfs@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration
On Wed, July 10, 2019 1:56 PM Greg KH wrote:
>On Wed, Jul 10, 2019 at 11:09:07AM +0800, Xiaoming Ni wrote:
>> Registering the same notifier to a hook repeatedly can cause the hook
>> list to form a ring or lose other members of the list.
>
>Then don't do that :)
>
Duplicate registration is checked and exited in notifier_chain_cond_register()
Duplicate registration was checked in notifier_chain_register() but only
the alarm was triggered without exiting. added by commit 831246570d34692e
("kernel/notifier.c: double register detection")
This patch is similar to commit 8312465 and notifier_chain_cond_register(),
with actual prevention for such behaviour, which I think is necessary to
avoid the formation of a linked list ring.
>Is there any in-kernel users that do do this? If so, please just fix
>them.
>
Notifier_chain_register() is not a hotspot path.
Adding a check here can make the kernel more stable.
Thanks
Xiaoming Ni
>thanks,
>
>greg k-h
>
Powered by blists - more mailing lists