From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>
Subject: [PATCH v1 net 0/6] rtnetlink: Handle error of rtnl_register_module().
Date: Thu, 3 Oct 2024 13:57:19 -0700 [thread overview]
Message-ID: <20241003205725.5612-1-kuniyu@amazon.com> (raw)
While converting phonet to per-netns RTNL, I found a weird comment
/* Further rtnl_register_module() cannot fail */
that was true but no longer true after commit addf9b90de22 ("net:
rtnetlink: use rcu to free rtnl message handlers").
Many callers of rtnl_register_module() just ignore the returned
value but should handle them properly.
This series introduces two helpers, rtnl_register_module_many() and
rtnl_unregister_module_many(), to do that easily and fix such callers.
All rtnl_register() and rtnl_register_module() will be converted
to _many() variant and some rtnl_lock() will be saved in _many()
later in net-next.
Kuniyuki Iwashima (6):
rtnetlink: Add bulk registration helpers for rtnetlink message
handlers.
vxlan: Handle error of rtnl_register_module().
bridge: Handle error of rtnl_register_module().
mctp: Handle error of rtnl_register_module().
mpls: Handle error of rtnl_register_module().
phonet: Handle error of rtnl_register_module().
drivers/net/vxlan/vxlan_core.c | 6 ++++-
drivers/net/vxlan/vxlan_private.h | 2 +-
drivers/net/vxlan/vxlan_vnifilter.c | 19 ++++++++--------
include/net/mctp.h | 2 +-
include/net/rtnetlink.h | 19 ++++++++++++++++
net/bridge/br_netlink.c | 6 ++++-
net/bridge/br_private.h | 5 +++--
net/bridge/br_vlan.c | 19 ++++++++--------
net/core/rtnetlink.c | 30 +++++++++++++++++++++++++
net/mctp/af_mctp.c | 6 ++++-
net/mctp/device.c | 30 +++++++++++++++----------
net/mctp/neigh.c | 29 ++++++++++++++----------
net/mctp/route.c | 34 ++++++++++++++++++++---------
net/mpls/af_mpls.c | 32 +++++++++++++++++----------
net/phonet/pn_netlink.c | 27 +++++++++--------------
15 files changed, 178 insertions(+), 88 deletions(-)
--
2.30.2
next reply other threads:[~2024-10-03 20:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 20:57 Kuniyuki Iwashima [this message]
2024-10-03 20:57 ` [PATCH v1 net 1/6] rtnetlink: Add bulk registration helpers for rtnetlink message handlers Kuniyuki Iwashima
2024-10-03 20:57 ` [PATCH v1 net 2/6] vxlan: Handle error of rtnl_register_module() Kuniyuki Iwashima
2024-10-03 20:57 ` [PATCH v1 net 3/6] bridge: " Kuniyuki Iwashima
2024-10-03 20:57 ` [PATCH v1 net 4/6] mctp: " Kuniyuki Iwashima
2024-10-04 0:39 ` Jakub Kicinski
2024-10-04 1:00 ` Kuniyuki Iwashima
2024-10-04 16:06 ` Jakub Kicinski
2024-10-04 19:49 ` Kuniyuki Iwashima
2024-10-03 20:57 ` [PATCH v1 net 5/6] mpls: " Kuniyuki Iwashima
2024-10-03 20:57 ` [PATCH v1 net 6/6] phonet: " Kuniyuki Iwashima
2024-10-04 7:12 ` Rémi Denis-Courmont
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=20241003205725.5612-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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).