From patchwork Wed Sep 15 21:09:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 396 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.22]) by open-mesh.org (Postfix) with SMTP id 07C7A15416B for ; Wed, 15 Sep 2010 23:08:51 +0200 (CEST) Received: (qmail invoked by alias); 15 Sep 2010 21:08:49 -0000 Received: from i59F6ABD3.versanet.de (EHLO sven-desktop.lazhur.ath.cx) [89.246.171.211] by mail.gmx.net (mp038) with SMTP; 15 Sep 2010 23:08:49 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX18d2EBU9HsdPNnM2qcQSALDs3Nf/Llqk/nBjVbTWu NzNBEy6qMLWbKO From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Wed, 15 Sep 2010 23:09:36 +0200 Message-Id: <1284584976-22596-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 X-Y-GMX-Trusted: 0 Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: wait for call_rcu before unloading module X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 21:08:51 -0000 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 Signed-off-by: Sven Eckelmann --- batman-adv/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/batman-adv/main.c b/batman-adv/main.c index e8acb46..a067f75 100644 --- a/batman-adv/main.c +++ b/batman-adv/main.c @@ -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)