linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] coredump: fix unfreezable coredumping task
@ 2016-09-30  8:50 Andrey Ryabinin
  2016-09-30  9:01 ` Andrey Ryabinin
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Andrey Ryabinin @ 2016-09-30  8:50 UTC (permalink / raw)
  To: Alexander Viro, Tejun Heo, Rafael J. Wysocki, Pavel Machek,
	Oleg Nesterov
  Cc: linux-pm, linux-fsdevel, linux-kernel, Andrey Ryabinin, stable

It could be not possible to freeze coredumping task when it waits
for 'core_state->startup' completion, because threads are frozen
in get_signal() before they got a chance to complete 'core_state->startup'.

Use freezer_do_not_count() to tell freezer to ignore coredumping
task while it waits for core_state->startup completion.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: stable@vger.kernel.org
---
 fs/coredump.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/coredump.c b/fs/coredump.c
index 281b768..eb9c92c 100644
--- a/fs/coredump.c
+++ b/fs/coredump.c
@@ -1,6 +1,7 @@
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/fdtable.h>
+#include <linux/freezer.h>
 #include <linux/mm.h>
 #include <linux/stat.h>
 #include <linux/fcntl.h>
@@ -423,7 +424,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state)
 	if (core_waiters > 0) {
 		struct core_thread *ptr;
 
+		freezer_do_not_count();
 		wait_for_completion(&core_state->startup);
+		freezer_count();
 		/*
 		 * Wait for all the threads to become inactive, so that
 		 * all the thread context (extended register state, like
-- 
2.7.3

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-11-08 16:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30  8:50 [PATCH] coredump: fix unfreezable coredumping task Andrey Ryabinin
2016-09-30  9:01 ` Andrey Ryabinin
2016-09-30 12:47 ` Oleg Nesterov
2016-10-04  7:18   ` Michal Hocko
2016-10-04 16:13     ` Oleg Nesterov
2016-10-05  9:17       ` Michal Hocko
2016-10-03  9:41 ` Pavel Machek
2016-11-07 16:27 ` Andrey Ryabinin
2016-11-07 22:26 ` Andrew Morton
2016-11-08  9:36   ` Andrey Ryabinin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).