]> git.karo-electronics.de Git - karo-tx-linux.git/commit
coredump: change wait_for_dump_helpers() to use wait_event_interruptible()
authorOleg Nesterov <oleg@redhat.com>
Wed, 20 Mar 2013 04:08:31 +0000 (15:08 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Mar 2013 04:23:26 +0000 (15:23 +1100)
commitabee29289b86b9cd4c9427cbc09e0986e3c85685
treee9193362f2f832d5c4c06b537a87c9c2b514b102
parentd3d4c6d5387801479dfbf80785ce045ed2406b8a
coredump: change wait_for_dump_helpers() to use wait_event_interruptible()

wait_for_dump_helpers() calls wake_up/kill_fasync from inside the
wait_event-like loop.  This is not needed and in fact this is not strictly
correct, we can/should do this only once after we change pipe->writers.
We could even check if it becomes zero.

Change this code to use use wait_event_interruptible(), this can also help
to make this wait freezable.

With this patch we check pipe->readers without pipe_lock(), this is fine.
Once we see pipe->readers == 1 we know that the handler decremented the
counter, this is all we need.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Mandeep Singh Baines <msb@chromium.org>
Cc: Neil Horman <nhorman@redhat.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/coredump.c