[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241004222358.79129-1-kuniyu@amazon.com>
Date: Fri, 4 Oct 2024 15:23:52 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>
CC: Kuniyuki Iwashima <kuniyu@...zon.com>, Kuniyuki Iwashima
<kuni1840@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH v2 net 0/6] rtnetlink: Handle error of rtnl_register_module().
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.
Changes:
v2: Remove __exit from mctp_neigh_exit().
v1: https://lore.kernel.org/netdev/20241003205725.5612-1-kuniyu@amazon.com/
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 | 31 ++++++++++++++++----------
net/mctp/route.c | 34 ++++++++++++++++++++---------
net/mpls/af_mpls.c | 32 +++++++++++++++++----------
net/phonet/pn_netlink.c | 27 +++++++++--------------
15 files changed, 179 insertions(+), 89 deletions(-)
--
2.30.2
Powered by blists - more mailing lists