lkml.org 
[lkml]   [2019]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v4 05/22] ethtool: introduce ethtool netlink interface
On Thu, Mar 21, 2019 at 03:13:43PM +0100, Michal Kubecek wrote:
> On Thu, Mar 21, 2019 at 02:57:05PM +0100, Andrew Lunn wrote:
> > On Thu, Mar 21, 2019 at 02:07:35PM +0100, Michal Kubecek wrote:
> > > +static int __init ethnl_init(void)
> > > +{
> > > + int ret;
> > > +
> > > + ret = genl_register_family(&ethtool_genl_family);
> > > + if (ret < 0)
> > > + panic("ethtool: could not register genetlink family\n");
> >
> > Panic seems a bit strong. Do we really want to kill the box because
> > this fails?
>
> When I switched CONFIG_ETHTOOL_NETLINK from tristate to bool, I checked
> some other non-modular subsystems to see what they do on failed
> initialization and each of them did handle it by panic() so I didn't
> think about it too much and did the same.
>
> Thinking about it now, if the family registration fails, the only entry
> point to care about should be ethtool_notify() (I'll have to check more
> carefully to be sure) so that adding a check there should be sufficient
> to let everything work (except for the netlink interface, of course).

Hi Michal

So maybe do a WARN_ON() and return the error code.

Linus has been quite vocal about killing the box when there is no real
need...

Andrew

\
 
 \ /
  Last update: 2019-03-21 16:26    [W:0.074 / U:0.020 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site