Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sched, fanotify: Deal with nested sleeps
As per e23738a ("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 <[email protected]> Reported-by: Sedat Dilek <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Al Viro <[email protected]> Cc: Eric Paris <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Eric Paris <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
- Loading branch information