remarkable-linux/fs/notify/fanotify
Peter Zijlstra 536ebe9ca9 sched, fanotify: Deal with nested sleeps
As per e23738a730 ("sched, inotify: Deal with nested sleeps").

fanotify_read is a wait loop with sleeps in. Wait loops rely on
task_struct::state and sleeps do too, since that's the only means of
actually sleeping. Therefore the nested sleeps destroy the wait loop
state and the wait loop breaks the sleep functions that assume
TASK_RUNNING (mutex_lock).

Fix this by using the new woken_wake_function and wait_woken() stuff,
which registers wakeups in wait and thereby allows shrinking the
task_state::state changes to the actual sleep part.

Reported-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Paris <eparis@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Paris <eparis@redhat.com>
Link: http://lkml.kernel.org/r/20141216152838.GZ3337@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-01-09 11:18:12 +01:00
..
fanotify.c fanotify: fix double free of pending permission events 2014-08-06 18:01:12 -07:00
fanotify.h fanotify: use fanotify event structure for permission response processing 2014-04-03 16:20:51 -07:00
fanotify_user.c sched, fanotify: Deal with nested sleeps 2015-01-09 11:18:12 +01:00
Kconfig treewide: fix typo of "suport" in various comments and Kconfig 2012-11-19 14:16:09 +01:00
Makefile fanotify: fanotify_init syscall declaration 2010-07-28 09:58:55 -04:00