linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoming Ni <nixiaoming@huawei.com>
To: Vasily Averin <vvs@virtuozzo.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "adobriyan@gmail.com" <adobriyan@gmail.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
	"arjan@linux.intel.com" <arjan@linux.intel.com>,
	"bfields@fieldses.org" <bfields@fieldses.org>,
	"chuck.lever@oracle.com" <chuck.lever@oracle.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"jlayton@kernel.org" <jlayton@kernel.org>,
	"luto@kernel.org" <luto@kernel.org>,
	"mingo@kernel.org" <mingo@kernel.org>,
	"Nadia.Derbey@bull.net" <Nadia.Derbey@bull.net>,
	"paulmck@linux.vnet.ibm.com" <paulmck@linux.vnet.ibm.com>,
	"semen.protsenko@linaro.org" <semen.protsenko@linaro.org>,
	"stable@kernel.org" <stable@kernel.org>,
	"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"trond.myklebust@hammerspace.com"
	<trond.myklebust@hammerspace.com>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	"Huangjianhui (Alex)" <alex.huangjianhui@huawei.com>,
	Dailei <dylix.dailei@huawei.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration
Date: Tue, 10 Sep 2019 11:57:55 +0800	[thread overview]
Message-ID: <664674a5-5ed9-8f0a-27ae-b4b868e96bdb@huawei.com> (raw)
In-Reply-To: <0d245a97-1169-9ef2-e502-043ba80eaa8c@virtuozzo.com>


On 2019/7/17 19:15, Vasily Averin wrote:
> On 7/16/19 5:07 PM, Xiaoming Ni wrote:
>> On 2019/7/16 18:20, Vasily Averin wrote:
>>> On 7/16/19 5:00 AM, Xiaoming Ni wrote:
>>>> On 2019/7/15 13:38, Vasily Averin wrote:
>>>>> On 7/14/19 5:45 AM, Xiaoming Ni wrote:
>>>>>> On 2019/7/12 22:07, gregkh@linuxfoundation.org wrote:
>>>>>>> On Fri, Jul 12, 2019 at 09:11:57PM +0800, Xiaoming Ni wrote:
>>>>>>>> On 2019/7/11 21:57, Vasily Averin wrote:
>>>>>>>>> On 7/11/19 4:55 AM, Nixiaoming wrote:
>>>>>>>>>> On Wed, July 10, 2019 1:49 PM Vasily Averin wrote:
>>>>>>>>>>> On 7/10/19 6:09 AM, Xiaoming Ni wrote:
....
...
>>>>>>>> So in these two cases, is it more reasonable to trigger BUG() directly when checking for duplicate registration ?
>>>>>>>> But why does current notifier_chain_register() just trigger WARN() without exiting ?
>>>>>>>> notifier_chain_cond_register() direct exit without triggering WARN() ?
>>>>>>>
>>>>>>> It should recover from this, if it can be detected.  The main point is
>>>>>>> that not all apis have to be this "robust" when used within the kernel
>>>>>>> as we do allow for the callers to know what they are doing :)
>>>>>>>
>>>>>> In the notifier_chain_register(), the condition ( (*nl) == n) is the same registration of the same hook.
>>>>>>  We can intercept this situation and avoid forming a linked list ring to make the API more rob
...
...

> Yes, I'm agree, at present there are no difference between
> notifier_chain_cond_register() and notifier_chain_register()
> 
> Question is -- how to improve it.
> You propose to remove notifier_chain_cond_register() by some way.
> Another option is return an error, for some abstract callers who expect possible double registration.
> 
> Frankly speaking I prefer second one,
> however because of kernel do not have any such callers right now seems you are right, 
> and we can delete notifier_chain_cond_register().
> 
> So let me finally accept your patch-set.
> 
> Thank you,
> 	Vasily Averin
> 
> .
>

Dear Greg Kroah-Hartman
is there any other opinion on this patch set?
can you pick this series?

thanks
	Xiaoming Ni


  reply	other threads:[~2019-09-10  3:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  3:09 [PATCH v3 0/3] kernel/notifier.c: avoid duplicate registration Xiaoming Ni
2019-07-10  5:49 ` Vasily Averin
2019-07-11  1:55   ` Nixiaoming
2019-07-11 13:57     ` Vasily Averin
2019-07-12 13:11       ` Xiaoming Ni
2019-07-12 14:07         ` gregkh
2019-07-14  2:45           ` Xiaoming Ni
2019-07-15  5:38             ` Vasily Averin
2019-07-16  2:00               ` Xiaoming Ni
2019-07-16 10:20                 ` Vasily Averin
2019-07-16 14:07                   ` Xiaoming Ni
2019-07-17 11:15                     ` Vasily Averin
2019-09-10  3:57                       ` Xiaoming Ni [this message]
2019-07-10  5:56 ` Greg KH
2019-07-11  1:32   ` Nixiaoming

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=664674a5-5ed9-8f0a-27ae-b4b868e96bdb@huawei.com \
    --to=nixiaoming@huawei.com \
    --cc=Nadia.Derbey@bull.net \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.huangjianhui@huawei.com \
    --cc=anna.schumaker@netapp.com \
    --cc=arjan@linux.intel.com \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=dylix.dailei@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=semen.protsenko@linaro.org \
    --cc=stable@kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=trond.myklebust@hammerspace.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vvs@virtuozzo.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).