]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: document NETDEV_CHANGENAME as ops locked
authorJakub Kicinski <kuba@kernel.org>
Wed, 3 Jun 2026 01:28:32 +0000 (18:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 4 Jun 2026 21:04:55 +0000 (14:04 -0700)
NETDEV_CHANGENAME is only emitted from netif_change_name().
netif_change_name() has two callers both of which hold netdev_lock_ops()
around the call site:
 - dev_change_name()
 - do_setlink()

Document NETDEV_CHANGENAME as always ops locked.

Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260603012840.2254293-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Documentation/networking/netdevices.rst
net/core/lock_debug.c

index 60492d4df2ee89450442c5d094898c3c84f22621..8fc96975b3bd6212c6915a52cca9377ec928e702 100644 (file)
@@ -415,6 +415,7 @@ The following netdev notifiers are always run under the instance lock:
 For devices with locked ops, currently only the following notifiers are
 running under the lock:
 * ``NETDEV_CHANGE``
+* ``NETDEV_CHANGENAME``
 * ``NETDEV_REGISTER``
 * ``NETDEV_UP``
 
index 14fd8fcdcd562a946b8c0d14c57afc5a4fed9b2f..8a81c54307053670be8d8882bcd70d5cbf143b1c 100644 (file)
@@ -65,6 +65,7 @@ int netdev_debug_event(struct notifier_block *nb, unsigned long event,
                break;
 
        case NETDEV_CHANGENAME:
+               netdev_assert_locked_ops(dev);
                ASSERT_RTNL_NET(net);
                break;
        }