From: Alan Stern <stern@rowland.harvard.edu>
To: Borislav Petkov <bp@alien8.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Ayush Sawal <ayush.sawal@chelsio.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rohit Maheshwari <rohitm@chelsio.com>,
Steven Rostedt <rostedt@goodmis.org>,
Vinay Kumar Yadav <vinay.yadav@chelsio.com>,
alsa-devel@alsa-project.org,
bcm-kernel-feedback-list@broadcom.com,
intel-gfx@lists.freedesktop.org,
intel-gvt-dev@lists.freedesktop.org, linux-alpha@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org,
linux-fbdev@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-iio@vger.kernel.org, linux-leds@vger.kernel.org,
linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-remoteproc@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sh@vger.kernel.org,
linux-staging@lists.linux.dev, linux-tegra@vger.kernel.org,
linux-um@lists.infradead.org, linux-usb@vger.kernel.org,
linux-xtensa@linux-xtensa.org, netdev@vger.kernel.org,
openipmi-developer@lists.sourceforge.net, rcu@vger.kernel.org,
sparclinux@vger.kernel.org, x86@kernel.org,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v0 00/42] notifiers: Return an error when callback is already registered
Date: Mon, 8 Nov 2021 09:17:03 -0500 [thread overview]
Message-ID: <20211108141703.GB1666297@rowland.harvard.edu> (raw)
In-Reply-To: <20211108101924.15759-1-bp@alien8.de>
On Mon, Nov 08, 2021 at 11:19:24AM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> Hi all,
>
> this is a huge patchset for something which is really trivial - it
> changes the notifier registration routines to return an error value
> if a notifier callback is already present on the respective list of
> callbacks. For more details scroll to the last patch.
>
> Everything before it is converting the callers to check the return value
> of the registration routines and issue a warning, instead of the WARN()
> notifier_chain_register() does now.
What reason is there for moving the check into the callers? It seems
like pointless churn. Why not add the error return code, change the
WARN to pr_warn, and leave the callers as they are? Wouldn't that end
up having exactly the same effect?
For that matter, what sort of remedial action can a caller take if the
return code is -EEXIST? Is there any point in forcing callers to check
the return code if they can't do anything about it?
> Before the last patch has been applied, though, that checking is a
> NOP which would make the application of those patches trivial - every
> maintainer can pick a patch at her/his discretion - only the last one
> enables the build warnings and that one will be queued only after the
> preceding patches have all been merged so that there are no build
> warnings.
Why should there be _any_ build warnings? The real problem occurs when
a notifier callback is added twice, not when a caller fails to check the
return code. Double-registration is not the sort of thing that can be
detected at build time.
Alan Stern
> Due to the sheer volume of the patches, I have addressed the respective
> patch and the last one, which enables the warning, with addressees for
> each maintained area so as not to spam people unnecessarily.
>
> If people prefer I carry some through tip, instead, I'll gladly do so -
> your call.
>
> And, if you think the warning messages need to be more precise, feel
> free to adjust them before committing.
>
> Thanks!
next prev parent reply other threads:[~2021-11-08 14:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20211108101157.15189-1-bp@alien8.de>
2021-11-08 10:11 ` [PATCH v0 10/42] leds: trigger: Check notifier registration return value Borislav Petkov
2021-11-08 10:11 ` [PATCH v0 42/42] notifier: Return an error when callback is already registered Borislav Petkov
2021-11-08 14:07 ` Geert Uytterhoeven
2021-11-08 14:21 ` Borislav Petkov
2021-11-08 15:25 ` Geert Uytterhoeven
2021-11-08 15:58 ` Borislav Petkov
2021-11-08 16:12 ` Geert Uytterhoeven
2021-11-08 16:21 ` Borislav Petkov
2021-11-08 20:59 ` Alan Stern
2021-11-08 21:18 ` Borislav Petkov
2021-11-08 10:19 ` [PATCH v0 00/42] notifiers: " Borislav Petkov
2021-11-08 14:17 ` Alan Stern [this message]
2021-11-08 14:24 ` Borislav Petkov
2021-11-08 14:35 ` Borislav Petkov
2021-11-08 16:23 ` Steven Rostedt
2021-11-08 16:29 ` Borislav Petkov
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=20211108141703.GB1666297@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=alsa-devel@alsa-project.org \
--cc=arnd@arndb.de \
--cc=ayush.sawal@chelsio.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bp@alien8.de \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=rcu@vger.kernel.org \
--cc=rohitm@chelsio.com \
--cc=rostedt@goodmis.org \
--cc=sparclinux@vger.kernel.org \
--cc=vinay.yadav@chelsio.com \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.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 NNTP newsgroup(s).