diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-06-13 07:41:30 +0200 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2016-08-09 07:54:27 +0200 |
commit | 77d69d8ce17ce0d2a29d042e27943b0a8cea302d (patch) | |
tree | 6a35b79ba4b054d09f127dd7dba8e2053fb9195f /net/batman-adv/soft-interface.c | |
parent | f2c750fedd2e102b95a3b1008703b9f54bbc9b08 (diff) |
batman-adv: Modify mesh_iface outside sysfs context
The legacy sysfs interface to modify interfaces belonging to batman-adv
is run inside a region holding s_lock. And to add a net_device, it has
to also get the rtnl_lock. This is exactly the other way around than in
other virtual net_devices and conflicts with netdevice notifier which
executes inside rtnl_lock.
The inverted lock situation is currently solved by executing the removal
of netdevices via workqueue. The workqueue isn't executed inside
rtnl_lock and thus can independently get the s_lock and the rtnl_lock.
But this workaround fails when the netdevice notifier creates events in
quick succession and the earlier triggered removal of a net_device isn't
processed in the workqueue before the adding of the new netdevice (with
same name) event is issued.
Instead the legacy sysfs interface store events have to be enqueued in
a workqueue to loose the s_lock. The worker is then free to get the
required locks and the deadlock is avoided.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/soft-interface.c')
0 files changed, 0 insertions, 0 deletions