From patchwork Sat Sep 18 19:01:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 423 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.org (Postfix) with SMTP id 38739154405 for ; Sat, 18 Sep 2010 21:00:31 +0200 (CEST) Received: (qmail invoked by alias); 18 Sep 2010 19:00:30 -0000 Received: from unknown (EHLO sven-desktop.lazhur.ath.cx) [88.130.165.18] by mail.gmx.net (mp009) with SMTP; 18 Sep 2010 21:00:30 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1+FB694BSOFQ+Wfd9Aw29ga9oa/UxgmMuhzfn+x9t Ko1g8+KW6HcVG6 From: Sven Eckelmann To: greg@kroah.com Date: Sat, 18 Sep 2010 21:01:14 +0200 Message-Id: <1284836482-23431-5-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1284836482-23431-1-git-send-email-sven.eckelmann@gmx.de> References: <1284836482-23431-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 04/12] Staging: 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: Sat, 18 Sep 2010 19:00:31 -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 --- drivers/staging/batman-adv/main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c index 78ceebf..580ca02 100644 --- a/drivers/staging/batman-adv/main.c +++ b/drivers/staging/batman-adv/main.c @@ -72,7 +72,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)