On Friday, January 11, 2013 17:19:51 Simon Wunderlich wrote:
When processing the unregister notify for a hard interface, removing the sysfs files may lead to a circular deadlock (rtnl mutex <-> s_active).
To overcome this problem, postpone the sysfs removal in a worker.
Reported-by: Sasha Levin sasha.levin@oracle.com Reported-by: Sven Eckelmann sven@narfation.org Signed-off-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de
Changes from PATCHv2:
- kerneldoc for functions
Changes from PATCHv1:
- INIT_WORK() in respective struct initialization functions
- kerneldoc
Changes from RFCv1:
- use work_struct properly, instead of delayed_work
- postpone for softifs as well as for hardifs
Postponing the sysfs removal for the hardif unregister is easier than other alternatives involving deferring. This should bring us to the same level to the bridge code, which also messes with sysfs in the notifier processing function, and uses rtnl_trylock when called from within sysfs.
As far as I could understand the net/core code, only the unregister case is the critical one, so the original bug should hopefully be fixed.
hard-interface.c | 24 ++++++++++++++++++++++-- soft-interface.c | 32 +++++++++++++++++++++++++++++--- types.h | 6 ++++++ 3 files changed, 57 insertions(+), 5 deletions(-)
Applied in revision a33c882.
Thanks, Marek