[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241007154210.22366-1-kuniyu@amazon.com>
Date: Mon, 7 Oct 2024 08:42:10 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <ebiederm@...ssion.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<kuni1840@...il.com>, <kuniyu@...zon.com>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>
Subject: Re: [PATCH v3 net 5/6] mpls: Handle error of rtnl_register_module().
From: "Eric W. Biederman" <ebiederm@...ssion.com>
Date: Mon, 07 Oct 2024 09:56:44 -0500
> Kuniyuki Iwashima <kuniyu@...zon.com> writes:
>
> > Since introduced, mpls_init() has been ignoring the returned
> > value of rtnl_register_module(), which could fail.
>
> As I recall that was deliberate. The module continues to work if the
> rtnetlink handlers don't operate, just some functionality is lost.
It's ok if it wasn't a module. rtnl_register() logs an error message
in syslog, but rtnl_register_module() doesn't. That's why this series
only changes some rtnl_register_module() calls.
>
> I don't strongly care either way, but I want to point out that bailing
> out due to a memory allocation failure actually makes the module
> initialization more brittle.
>
> > Let's handle the errors by rtnl_register_many().
>
> Can you describe what the benefit is from completely giving up in the
> face of a memory allocation failure versus having as much of the module
> function as possible?
What if the memory pressure happend to be relaxed soon after the module
was loaded incompletely ?
Silent failure is much worse to me.
rtnl_get_link() will return NULL and users will see -EOPNOTSUPP even
though the module was loaded "successfully".
Powered by blists - more mailing lists