From: Kuniyuki Iwashima <kuniyu@amazon•com>
To: <ebiederm@xmission•com>
Cc: <davem@davemloft•net>, <edumazet@google•com>, <kuba@kernel•org>,
<kuni1840@gmail•com>, <kuniyu@amazon•com>,
<netdev@vger•kernel.org>, <pabeni@redhat•com>
Subject: Re: [PATCH v3 net 5/6] mpls: Handle error of rtnl_register_module().
Date: Mon, 7 Oct 2024 08:42:10 -0700 [thread overview]
Message-ID: <20241007154210.22366-1-kuniyu@amazon.com> (raw)
In-Reply-To: <87h69ohsgj.fsf@email.froward.int.ebiederm.org>
From: "Eric W. Biederman" <ebiederm@xmission•com>
Date: Mon, 07 Oct 2024 09:56:44 -0500
> Kuniyuki Iwashima <kuniyu@amazon•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".
next prev parent reply other threads:[~2024-10-07 15:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 12:44 [PATCH v3 net 0/6] rtnetlink: Handle error of rtnl_register_module() Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 1/6] rtnetlink: Add bulk registration helpers for rtnetlink message handlers Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 2/6] vxlan: Handle error of rtnl_register_module() Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 3/6] bridge: " Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 4/6] mctp: " Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 5/6] mpls: " Kuniyuki Iwashima
2024-10-07 14:56 ` Eric W. Biederman
2024-10-07 15:42 ` Kuniyuki Iwashima [this message]
2024-10-07 16:28 ` Eric W. Biederman
2024-10-07 18:21 ` Kuniyuki Iwashima
2024-10-07 22:18 ` Eric W. Biederman
2024-10-07 23:48 ` Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 6/6] phonet: " Kuniyuki Iwashima
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=20241007154210.22366-1-kuniyu@amazon.com \
--to=kuniyu@amazon$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=ebiederm@xmission$(echo .)com \
--cc=edumazet@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=kuni1840@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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