Adapt tunnels web view to new bmx6 syntax and options
[feed/routing.git] / batman-adv / patches / 0008-batman-adv-wait-for-rtnl-in-batadv_store_mesh_iface-.patch
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
6
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
9 of the sysfs nodes.
10
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.
16
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>
20 ---
21 sysfs.c | 5 +----
22 1 file changed, 1 insertion(+), 4 deletions(-)
23
24 diff --git a/sysfs.c b/sysfs.c
25 index 15a22ef..929e304 100644
26 --- a/sysfs.c
27 +++ b/sysfs.c
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))
30 goto out;
31
32 - if (!rtnl_trylock()) {
33 - ret = -ERESTARTSYS;
34 - goto out;
35 - }
36 + rtnl_lock();
37
38 if (status_tmp == BATADV_IF_NOT_IN_USE) {
39 batadv_hardif_disable_interface(hard_iface,
40 --
41 1.7.10.4
42