* [B.A.T.M.A.N.] [PATCH v2] batman-adv: Add lockdep assert for container_list_lock
@ 2015-12-20 8:04 Sven Eckelmann
2015-12-29 12:27 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2015-12-20 8:04 UTC (permalink / raw)
To: b.a.t.m.a.n
The batadv_tvlv_container* functions state in their kernel-doc that they
require tvlv.container_list_lock. Add an assert to automatically detect
when this might have been ignored by the caller.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v2: remove this from the kref patchset and instead submit it as standalone patch
net/batman-adv/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 19ad0bb..c9b8205 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -720,6 +720,8 @@ static struct batadv_tvlv_container
{
struct batadv_tvlv_container *tvlv_tmp, *tvlv = NULL;
+ lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
+
hlist_for_each_entry(tvlv_tmp, &bat_priv->tvlv.container_list, list) {
if (tvlv_tmp->tvlv_hdr.type != type)
continue;
@@ -752,6 +754,8 @@ static u16 batadv_tvlv_container_list_size(struct batadv_priv *bat_priv)
struct batadv_tvlv_container *tvlv;
u16 tvlv_len = 0;
+ lockdep_assert_held(&bat_priv->tvlv.container_list_lock);
+
hlist_for_each_entry(tvlv, &bat_priv->tvlv.container_list, list) {
tvlv_len += sizeof(struct batadv_tvlv_hdr);
tvlv_len += ntohs(tvlv->tvlv_hdr.len);
--
2.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH v2] batman-adv: Add lockdep assert for container_list_lock
2015-12-20 8:04 [B.A.T.M.A.N.] [PATCH v2] batman-adv: Add lockdep assert for container_list_lock Sven Eckelmann
@ 2015-12-29 12:27 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2015-12-29 12:27 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 518 bytes --]
On Sunday, December 20, 2015 09:04:03 Sven Eckelmann wrote:
> The batadv_tvlv_container* functions state in their kernel-doc that they
> require tvlv.container_list_lock. Add an assert to automatically detect
> when this might have been ignored by the caller.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v2: remove this from the kref patchset and instead submit it as standalone
> patch net/batman-adv/main.c | 4 ++++
> 1 file changed, 4 insertions(+)
Applied in revision 5f01697.
Thanks,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-29 12:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20 8:04 [B.A.T.M.A.N.] [PATCH v2] batman-adv: Add lockdep assert for container_list_lock Sven Eckelmann
2015-12-29 12:27 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).