Skip to contentSkip to conversation

batman-adv: wait for call_rcu before unloading module

PATCH Applied Sven Eckelmann 2 participants 2 messages Sep 15, 2010 – Sep 18, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 batman-adv: wait for call_rcu before unloading module

synchronize_rcu respective synchronize_net only waits for the rcu grace period to elapse and we may fail to finish the calls which were made to call_rcu in that time. In result the module could be unloaded during the execution of the RCU callbacks.

rcu_barrier[1] will now wait for all outstanding RCU callbacks to finish before continuing.

[1] Documentation/RCU/rcubarrier.txt

---
 batman-adv/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
batman-adv/main.c +1 -1
index e8acb46..a067f75 100644
@@ -74,7 +74,7 @@ static void __exit batman_exit(void)
 	destroy_workqueue(bat_event_workqueue);
 	bat_event_workqueue = NULL;
 
-	synchronize_net();
+	rcu_barrier();
 }
 
 int mesh_init(struct net_device *soft_iface)
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 9 lines · On Wednesday 15 September 2010 23:09:36 Sven Eckelmann wrote:

synchronize_rcu respective synchronize_net only waits for the rcu grace period to elapse and we may fail to finish the calls which were made to call_rcu in that time. In result the module could be unloaded during the execution of the RCU callbacks.

rcu_barrier[1] will now wait for all outstanding RCU callbacks to finish before continuing.

[1] Documentation/RCU/rcubarrier.txt

Applied in revision 1794.

Thanks,
Marek