The following commit has been merged in the master branch: commit 31162e763f614f0559670751188e1f967f093cbe Author: Linus Lüssing linus.luessing@web.de Date: Thu Nov 4 13:33:07 2010 +0000
batman-adv: Don't call sysfs_del_hardif() in atomic context
sysfs_del_hardif invokes kobject_put, which might sleep. However, we are not allowed to sleep during a call_rcu. There is also no need to do the removal with an atomic call_rcu, as kobject_put only frees the kobject when there is no more reference to it anyway.
Signed-off-by: Linus Lüssing linus.luessing@web.de
diff --git a/hard-interface.c b/hard-interface.c index 37f0f8b..a9b8367 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -41,7 +41,6 @@ static void hardif_free_rcu(struct rcu_head *rcu) struct batman_if *batman_if;
batman_if = container_of(rcu, struct batman_if, rcu); - sysfs_del_hardif(&batman_if->hardif_obj); dev_put(batman_if->net_dev); kref_put(&batman_if->refcount, hardif_free_ref); } @@ -470,6 +469,7 @@ static void hardif_remove_interface(struct batman_if *batman_if)
/* caller must take if_list_lock */ list_del_rcu(&batman_if->list); + sysfs_del_hardif(&batman_if->hardif_obj); call_rcu(&batman_if->rcu, hardif_free_rcu); }