public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Always synchronize rcu's on module shutdown
@ 2010-09-05 23:29 Linus Lüssing
  2010-09-06  7:30 ` Sven Eckelmann
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Lüssing @ 2010-09-05 23:29 UTC (permalink / raw)
  To: b.a.t.m.a.n

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.
Therefore, we should always flush all rcu callback functions scheduled
during the shutdown procedure.

Signed-off-by: Linus Lüssing <linus.luessing@web.de>
---
 main.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index 209a46b..e8acb46 100644
--- a/main.c
+++ b/main.c
@@ -73,6 +73,8 @@ static void __exit batman_exit(void)
 	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 @@ void mesh_free(struct net_device *soft_iface)
 	hna_local_free(bat_priv);
 	hna_global_free(bat_priv);
 
-	synchronize_net();
-
-	synchronize_rcu();
 	atomic_set(&bat_priv->mesh_state, MESH_INACTIVE);
 }
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-09-06 14:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-05 23:29 [B.A.T.M.A.N.] [PATCH] batman-adv: Always synchronize rcu's on module shutdown Linus Lüssing
2010-09-06  7:30 ` Sven Eckelmann
2010-09-06 10:09   ` Linus Lüssing
2010-09-06 12:07     ` Sven Eckelmann
2010-09-06 12:37       ` Linus Lüssing
2010-09-06 12:45         ` [B.A.T.M.A.N.] [PATCHv2] " Sven Eckelmann
2010-09-06 14:09           ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox