]> git.karo-electronics.de Git - karo-tx-linux.git/commit
coredump: make wait_for_dump_helpers() freezable
authorOleg Nesterov <oleg@redhat.com>
Sun, 10 Mar 2013 10:55:18 +0000 (21:55 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 12 Mar 2013 03:57:29 +0000 (14:57 +1100)
commit9cd20377fd1b8c4dce98428d256dacedb4937651
tree3cb4189e6a523efb10d0f1a47ac4b52168c3a51c
parent02d1c43033202368ea8dfc49e7df004e41b5ff0d
coredump: make wait_for_dump_helpers() freezable

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.

With this change it is trivial to convert this code to use
wait_event_freezable() and make this function freezable/killable, only
SIGKILL can set TIF_SIGPENDING.

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.

Note: wait_event_freezable() is "strange", perhaps it should be changed or
simply removed.  In the latter case we can change this code again to use
freezer_do_not_count + wait_event_interruptible.

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