diff options
author | Sven Eckelmann <sven@narfation.org> | 2016-06-13 08:41:32 +0300 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2016-08-09 08:54:28 +0300 |
commit | f4acb1086bc972f69e1ae14ec5b4473bc6c02dd5 (patch) | |
tree | 12ce27ffd9d476342c13960d017e747d762188af /lib/netdev-notifier-error-inject.c | |
parent | 569c98504b2004dba207127bcceb8f3aeb9b8e7d (diff) | |
download | linux-f4acb1086bc972f69e1ae14ec5b4473bc6c02dd5.tar.xz |
batman-adv: Avoid sysfs name collision for netns moves
The kobject_put is only removing the sysfs entry and corresponding entries
when its reference counter becomes zero. This tends to lead to collisions
when a device is moved between two different network namespaces because
some of the sysfs files have to be removed first and then added again to
the already moved sysfs entry.
WARNING: CPU: 0 PID: 290 at lib/kobject.c:240 kobject_add_internal+0x5ec/0x8a0
kobject_add_internal failed for batman_adv with -EEXIST, don't try to register things with the same name in the same directory.
But the caller of kobject_put can already remove the sysfs entry before it
does the kobject_put. This removal is done even when the reference counter
is not yet zero and thus avoids the problem.
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 'lib/netdev-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions