io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] io-wq: ensure we exit if thread group is exiting
@ 2021-09-22 14:49 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2021-09-22 14:49 UTC (permalink / raw)
  To: io-uring

Dave reports that a coredumping workload gets stuck in 5.15-rc2, and
identified the culprit in the Fixes line below. The problem is that
relying solely on fatal_signal_pending() to gate whether to exit or not
fails miserably if a process gets eg SIGILL sent. Don't exclusively
rely on fatal signals, also check if the thread group is exiting.

Fixes: 15e20db2e0ce ("io-wq: only exit on fatal signals")
Reported-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/fs/io-wq.c b/fs/io-wq.c
index c2e0e8e80949..c2360cdc403d 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -584,7 +584,8 @@ static int io_wqe_worker(void *data)
 
 			if (!get_signal(&ksig))
 				continue;
-			if (fatal_signal_pending(current))
+			if (fatal_signal_pending(current) ||
+			    signal_group_exit(current->signal))
 				break;
 			continue;
 		}
-- 
Jens Axboe


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-22 14:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 14:49 [PATCH] io-wq: ensure we exit if thread group is exiting Jens Axboe

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).