]> www.infradead.org Git - users/hch/misc.git/commit
Merge branch 'rtnetlink-handle-error-of-rtnl_register_module'
authorPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 13:39:37 +0000 (15:39 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Oct 2024 13:39:38 +0000 (15:39 +0200)
commitffc8fa91bef547ed419fb093e5e1703567552d2a
treee4dce5ab51ea4be31ef0c8dc6687634bcb940197
parent9a3cd877dc93061fbbe0c834d53d89639e7ea46a
parentb5e837c86041bef60f36cf9f20a641a30764379a
Merge branch 'rtnetlink-handle-error-of-rtnl_register_module'

Kuniyuki Iwashima says:

====================
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_many() and
rtnl_unregister_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:
  v4:
    * Add more context in changelog of each patch

  v3: https://lore.kernel.org/all/20241007124459.5727-1-kuniyu@amazon.com/
    * Move module *owner to struct rtnl_msg_handler
    * Make struct rtnl_msg_handler args/vars const
    * Update mctp goto labels

  v2: https://lore.kernel.org/netdev/20241004222358.79129-1-kuniyu@amazon.com/
    * Remove __exit from mctp_neigh_exit().

  v1: https://lore.kernel.org/netdev/20241003205725.5612-1-kuniyu@amazon.com/
====================

Link: https://patch.msgid.link/20241008184737.9619-1-kuniyu@amazon.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>