[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230107094909.530239-9-jiri@resnulli.us>
Date: Sat, 7 Jan 2023 10:49:09 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
edumazet@...gle.com, michael.chan@...adcom.com,
yisen.zhuang@...wei.com, salil.mehta@...wei.com,
jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
tariqt@...dia.com, saeedm@...dia.com, leon@...nel.org,
idosch@...dia.com, petrm@...dia.com, mailhol.vincent@...adoo.fr,
jacob.e.keller@...el.com, maximmi@...dia.com, gal@...dia.com
Subject: [patch net-next 8/8] devlink: add instance lock assertion in devl_is_registered()
From: Jiri Pirko <jiri@...dia.com>
After region and linecard lock removals, this helper is always supposed
to be called with instance lock held. So put the assertion here and
remove the comment which is no longer accurate.
Signed-off-by: Jiri Pirko <jiri@...dia.com>
---
net/devlink/devl_internal.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/devlink/devl_internal.h b/net/devlink/devl_internal.h
index 2b0e119e7b84..09fc4d60fefb 100644
--- a/net/devlink/devl_internal.h
+++ b/net/devlink/devl_internal.h
@@ -83,9 +83,7 @@ struct devlink *devlinks_xa_find_get(struct net *net, unsigned long *indexp);
static inline bool devl_is_registered(struct devlink *devlink)
{
- /* To prevent races the caller must hold the instance lock
- * or another lock taken during unregistration.
- */
+ devl_assert_locked(devlink);
return xa_get_mark(&devlinks, devlink->index, DEVLINK_REGISTERED);
}
--
2.39.0
Powered by blists - more mailing lists