From: Borislav Petkov <bp@alien8.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] notifier: Return non-null when callback already registered
Date: Fri, 21 May 2021 16:06:42 +0200 [thread overview]
Message-ID: <YKe+ckYQHebPYLBD@zn.tnic> (raw)
In-Reply-To: <YKeVbsLnAdpVUwAa@hirez.programming.kicks-ass.net>
On Fri, May 21, 2021 at 01:11:42PM +0200, Peter Zijlstra wrote:
> > @@ -25,7 +25,7 @@ static int notifier_chain_register(struct notifier_block **nl,
> > while ((*nl) != NULL) {
> > if (unlikely((*nl) == n)) {
> > WARN(1, "double register detected");
>
> That should give a big clue^
Yah, the big cluebat... Was wondering whether to remove it, actually.
But then I'd need to audit all users whether they handle retval
properly. Sounds like a kernelnewbies project to me...
> > - return 0;
> > + return 1;
>
> How about -EBUSY here?
Yah, anthing but 0.
But if we're gonna return -E things, -EEXIST looks like an even better
fit to me...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
prev parent reply other threads:[~2021-05-21 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 20:20 [RFC PATCH] notifier: Return non-null when callback already registered Borislav Petkov
2021-05-21 11:11 ` Peter Zijlstra
2021-05-21 14:06 ` Borislav Petkov [this message]
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=YKe+ckYQHebPYLBD@zn.tnic \
--to=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).