1 From 96cd7725540f4dccdd6fbb4fde59243e1cc1ad80 Mon Sep 17 00:00:00 2001
2 From: Matthias Schiffer <mschiffer@universe-factory.net>
3 Date: Tue, 28 May 2013 17:32:32 +0200
4 Subject: [PATCH 08/10] batman-adv: wait for rtnl in batadv_store_mesh_iface
5 instead of failing if it is taken
7 The rtnl_lock in batadv_store_mesh_iface has been converted to a rtnl_trylock
8 some time ago to avoid a possible deadlock between rtnl and s_active on removal
11 The behaviour introduced by that was quite confusing as it could lead to the
12 sysfs store to fail, making batman-adv setup scripts unreliable. As recently the
13 sysfs removal was postponed to a worker not running with the rtnl taken, the
14 deadlock can't occur any more and it is safe to change the trylock back to a
15 lock to make the sysfs store reliable again.
17 Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
18 Reviewed-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
19 Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
22 1 file changed, 1 insertion(+), 4 deletions(-)
24 diff --git a/sysfs.c b/sysfs.c
25 index 15a22ef..929e304 100644
28 @@ -582,10 +582,7 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj,
29 (strncmp(hard_iface->soft_iface->name, buff, IFNAMSIZ) == 0))
32 - if (!rtnl_trylock()) {
38 if (status_tmp == BATADV_IF_NOT_IN_USE) {
39 batadv_hardif_disable_interface(hard_iface,