[commits] r1788 - trunk/batman-adv

postmaster at open-mesh.org postmaster at open-mesh.org
Mon Sep 6 16:08:25 CEST 2010


Author: marek
Date: 2010-09-06 16:08:05 +0200 (Mon, 06 Sep 2010)
New Revision: 1788

Modified:
   trunk/batman-adv/main.c
Log:
batman-adv: Always synchronize rcu's on module shutdown

During the module shutdown procedure in batman_exit(), a rcu callback is
being scheduled (batman_exit -> hardif_remove_interfaces ->
hardif_remove_interfae -> call_rcu). However, when the kernel unloads
the module, the rcu callback might not have been executed yet, resulting
in a "unable to handle kernel paging request" in __rcu_process_callback
afterwards, causing the kernel to freeze.

The synchronize_net and synchronize_rcu in mesh_free are currently
called before the call_rcu in hardif_remove_interface and have no real
effect on it.

Therefore, we should always flush all rcu callback functions scheduled
during the shutdown procedure using synchronize_net. The call to
synchronize_rcu can be omitted because synchronize_net already calls it.

Signed-off-by: Linus L?\195?\188ssing <linus.luessing at web.de>
Acked-by: Sven Eckelmann <sven.eckelmann at gmx.de>

Modified: trunk/batman-adv/main.c
===================================================================
--- trunk/batman-adv/main.c	2010-09-04 23:47:38 UTC (rev 1787)
+++ trunk/batman-adv/main.c	2010-09-06 14:08:05 UTC (rev 1788)
@@ -73,6 +73,8 @@
 	flush_workqueue(bat_event_workqueue);
 	destroy_workqueue(bat_event_workqueue);
 	bat_event_workqueue = NULL;
+
+	synchronize_net();
 }
 
 int mesh_init(struct net_device *soft_iface)
@@ -135,9 +137,6 @@
 	hna_local_free(bat_priv);
 	hna_global_free(bat_priv);
 
-	synchronize_net();
-
-	synchronize_rcu();
 	atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
 }
 



More information about the commits mailing list