]> git.karo-electronics.de Git - karo-tx-linux.git/commit
epoll: fix nested calls support
authorDavide Libenzi <davidel@xmailserver.org>
Wed, 17 Jun 2009 23:25:58 +0000 (16:25 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 2 Jul 2009 23:50:05 +0000 (16:50 -0700)
commite45d471dc7a8735a989a000f5cf2caa3c1594c3a
treeba5028a8e830f98227e94739104a423ff7fb9800
parent2d0e9cfe4c616d2a1e7e3d4774b6b6b807321977
epoll: fix nested calls support

commit 3fe4a975d662f11037cb710f8b4b158a3e38f9c0 upstream.

This fixes a regression in 2.6.30.

I unfortunately accepted a patch time ago, to drop the "current" usage
from possible IRQ context, w/out proper thought over it.  The patch
switched to using the CPU id by bounding the nested call callback with a
get_cpu()/put_cpu().

Unfortunately the ep_call_nested() function can be called with a callback
that grabs sleepy locks (from own f_op->poll()), that results in epic
fails.  The following patch uses the proper "context" depending on the
path where it is called, and on the kind of callback.

This has been reported by Stefan Richter, that has also verified the patch
is his previously failing environment.

Signed-off-by: Davide Libenzi <davidel@xmailserver.org>
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/eventpoll.c