aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bridge_loop_avoidance.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-03-29 06:38:20 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-18 12:00:57 -0400
commit5d52dad27a08d2c8851acb12b041088ec07881dd (patch)
treef5f05095d17bf618eed08fc79ee969b48937dc59 /net/batman-adv/bridge_loop_avoidance.c
parentd2b6cc8e460494251442a877fcbc150faa175b4f (diff)
batman-adv: Initialize lockdep class keys for hashes
The hash for claim and backbone hash in the bridge loop avoidance code receive the same key because they are getting initialized by hash_new with the same key. Lockdep will create a backtrace when they are used recursively. This can be avoided by reinitializing the key directly after the hash_new. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bridge_loop_avoidance.c')
-rw-r--r--net/batman-adv/bridge_loop_avoidance.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index 8bf97515a77d..5c1ac559edbb 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1127,6 +1127,14 @@ out:
1127 bla_start_timer(bat_priv); 1127 bla_start_timer(bat_priv);
1128} 1128}
1129 1129
1130/* The hash for claim and backbone hash receive the same key because they
1131 * are getting initialized by hash_new with the same key. Reinitializing
1132 * them with to different keys to allow nested locking without generating
1133 * lockdep warnings
1134 */
1135static struct lock_class_key claim_hash_lock_class_key;
1136static struct lock_class_key backbone_hash_lock_class_key;
1137
1130/* initialize all bla structures */ 1138/* initialize all bla structures */
1131int bla_init(struct bat_priv *bat_priv) 1139int bla_init(struct bat_priv *bat_priv)
1132{ 1140{
@@ -1164,6 +1172,11 @@ int bla_init(struct bat_priv *bat_priv)
1164 if (!bat_priv->claim_hash || !bat_priv->backbone_hash) 1172 if (!bat_priv->claim_hash || !bat_priv->backbone_hash)
1165 return -1; 1173 return -1;
1166 1174
1175 batadv_hash_set_lock_class(bat_priv->claim_hash,
1176 &claim_hash_lock_class_key);
1177 batadv_hash_set_lock_class(bat_priv->backbone_hash,
1178 &backbone_hash_lock_class_key);
1179
1167 bat_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n"); 1180 bat_dbg(DBG_BLA, bat_priv, "bla hashes initialized\n");
1168 1181
1169 bla_start_timer(bat_priv); 1182 bla_start_timer(bat_priv);