]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
[PATCH] uml: fix spinlock recursion and sleep-inside-spinlock in error path
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Thu, 19 Jan 2006 01:42:56 +0000 (17:42 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 19 Jan 2006 03:20:21 +0000 (19:20 -0800)
commit71c8d4c3aad3132765d30b05dce98bb8a9508f02
treed9b21742707b5de48511663f2fcd1627fb9a5a86
parente56a78855a4f72fc658bfd21d08939dd6e09fa4c
[PATCH] uml: fix spinlock recursion and sleep-inside-spinlock in error path

In this error path, when the interface has had a problem, we call dev_close(),
which is disallowed for two reasons:

*) takes again the UML internal spinlock, inside the ->stop method of this
   device
*) can be called in process context only, while we're in interrupt context.

I've also thought that calling dev_close() may be a wrong policy to follow,
but it's not up to me to decide that.

However, we may end up with multiple dev_close() queued on the same device.
But the initial test for (dev->flags & IFF_UP) makes this harmless, though -
and dev_close() is supposed to care about races with itself.  So there's no
harm in delaying the shutdown, IMHO.

Something to mark the interface as "going to shutdown" would be appreciated,
but dev_deactivate has the same problems as dev_close(), so we can't use it
either.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/drivers/net_kern.c