batman-adv: Avoid RCU list-traversal in spinlock
authorSven Eckelmann <sven@narfation.org>
Sun, 16 Feb 2020 17:30:12 +0000 (18:30 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Mon, 17 Feb 2020 15:07:50 +0000 (16:07 +0100)
commit3b2582c7affde5f30bcc8321385507e66f4299e1
tree45bb6894c030f2799980ad83a2c22bb88cc054e7
parentedddb36644d56efc5833405bdf1c46f85677fc5c
batman-adv: Avoid RCU list-traversal in spinlock

The new CONFIG_PROVE_RCU_LIST requires a condition statement in
(h)list_for_each_entry_rcu when the code might be executed in a non RCU
non-reader section with the writer lock. Otherwise lockdep might cause a
false positive warning like

  =============================
  WARNING: suspicious RCU usage
  -----------------------------
  translation-table.c:940 RCU-list traversed in non-reader section!!

batman-adv is (mostly) following the examples from the RCU documentation
and is using the normal list-traversal primitives instead of the RCU
list-traversal primitives when the writer (spin)lock is held.

The remaining users of RCU list-traversal primitives with writer spinlock
have to be converted to the same style as the rest of the code.

Reported-by: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/translation-table.c