]> git.baikalelectronics.ru Git - kernel.git/commit
audit, sched/wait: Fixup kauditd_thread() wait loop
authorPeter Zijlstra <peterz@infradead.org>
Thu, 2 Oct 2014 10:22:51 +0000 (12:22 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 4 Nov 2014 06:17:47 +0000 (07:17 +0100)
commit6711bc7f8495dd3cecba435357a68f526e156e5c
tree78df97c7fec83de7c10d25027bdb6ab755349463
parentc8e3cc21cf0a49bded978aa97ba1e64069aaf6a0
audit, sched/wait: Fixup kauditd_thread() wait loop

The kauditd_thread wait loop is a bit iffy; it has a number of problems:

 - calls try_to_freeze() before schedule(); you typically want the
   thread to re-evaluate the sleep condition when unfreezing, also
   freeze_task() issues a wakeup.

 - it unconditionally does the {add,remove}_wait_queue(), even when the
   sleep condition is false.

Use wait_event_freezable() that does the right thing.

Reported-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Eric Paris <eparis@redhat.com>
Cc: oleg@redhat.com
Cc: Eric Paris <eparis@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20141002102251.GA6324@worktop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/audit.c