Staging: batman-adv: Don't remove interface with spinlock held
authorSven Eckelmann <sven.eckelmann@gmx.de>
Mon, 22 Nov 2010 11:34:50 +0000 (12:34 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 29 Nov 2010 18:53:14 +0000 (10:53 -0800)
commit9ee898739b7e4d292abed911008b3f91b442118a
treebcc05c7f9cf249b2391989a222e5e5f268886b4d
parent6df78338e7af7960b67fa00aa2a5c63986a23d3c
Staging: batman-adv: Don't remove interface with spinlock held

We call a lot of the netdevice code when holding if_list_lock which will
spin the whole time. This is not necessary because we only want to
protect the access to the list to be serialized. An extra queue can be
used which hold all interfaces which should be removed and then use that
queue without any locks for netdevice cleanup.

We create a "scheduling while atomic" Oops when calling different
netdevice related functions inside a spinlock protected area on a
preemtible kernel.

Reported-by: Rafal Lesniak <lesniak@eresi-project.org>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/hard-interface.c