OpenCloudOS-Kernel/net/devlink
Jakub Kicinski ed539ba614 devlink: always check if the devlink instance is registered
Always check under the instance lock whether the devlink instance
is still / already registered.

This is a no-op for the most part, as the unregistration path currently
waits for all references. On the init path, however, we may temporarily
open up a race with netdev code, if netdevs are registered before the
devlink instance. This is temporary, the next change fixes it, and this
commit has been split out for the ease of review.

Note that in case of iterating over sub-objects which have their
own lock (regions and line cards) we assume an implicit dependency
between those objects existing and devlink unregistration.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-01-06 12:56:19 +00:00
..
Makefile devlink: split out netlink code 2023-01-05 22:13:39 -08:00
core.c devlink: always check if the devlink instance is registered 2023-01-06 12:56:19 +00:00
devl_internal.h devlink: always check if the devlink instance is registered 2023-01-06 12:56:19 +00:00
leftover.c devlink: always check if the devlink instance is registered 2023-01-06 12:56:19 +00:00
netlink.c devlink: always check if the devlink instance is registered 2023-01-06 12:56:19 +00:00