[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211108141703.GB1666297@rowland.harvard.edu>
Date: Mon, 8 Nov 2021 09:17:03 -0500
From: Alan Stern <stern@...land.harvard.edu>
To: Borislav Petkov <bp@...en8.de>
Cc: LKML <linux-kernel@...r.kernel.org>, Arnd Bergmann <arnd@...db.de>,
Ayush Sawal <ayush.sawal@...lsio.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rohit Maheshwari <rohitm@...lsio.com>,
Steven Rostedt <rostedt@...dmis.org>,
Vinay Kumar Yadav <vinay.yadav@...lsio.com>,
alsa-devel@...a-project.org, bcm-kernel-feedback-list@...adcom.com,
intel-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org, linux-alpha@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-edac@...r.kernel.org,
linux-fbdev@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-iio@...r.kernel.org, linux-leds@...r.kernel.org,
linux-mips@...r.kernel.org, linux-parisc@...r.kernel.org,
linux-pm@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-remoteproc@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-s390@...r.kernel.org,
linux-scsi@...r.kernel.org, linux-sh@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-tegra@...r.kernel.org,
linux-um@...ts.infradead.org, linux-usb@...r.kernel.org,
linux-xtensa@...ux-xtensa.org, netdev@...r.kernel.org,
openipmi-developer@...ts.sourceforge.net, rcu@...r.kernel.org,
sparclinux@...r.kernel.org, x86@...nel.org,
xen-devel@...ts.xenproject.org
Subject: Re: [PATCH v0 00/42] notifiers: Return an error when callback is
already registered
On Mon, Nov 08, 2021 at 11:19:24AM +0100, Borislav Petkov wrote:
> From: Borislav Petkov <bp@...e.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!
Powered by blists - more mailing lists