From 15e20db2e0cecce0bfc6a67b69e55020fe9cda00 Mon Sep 17 00:00:00 2001
From: Jens Axboe <axboe@kernel.dk>
Date: Wed, 1 Sep 2021 11:18:41 -0600
Subject: [PATCH] io-wq: only exit on fatal signals
Git-commit: 15e20db2e0cecce0bfc6a67b69e55020fe9cda00
Patch-mainline: v5.15-rc1
References: bsc#1199011
If the application uses io_uring and also relies heavily on signals
for communication, that can cause io-wq workers to spuriously exit
just because the parent has a signal pending. Just ignore signals
unless they are fatal.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Acked-by: David Disseldorp <ddiss@suse.de>
---
fs/io-wq.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/io-wq.c b/fs/io-wq.c
index 8cba77a937a1..027eb4e13e3b 100644
--- a/fs/io-wq.c
+++ b/fs/io-wq.c
@@ -575,7 +575,9 @@ static int io_wqe_worker(void *data)
if (!get_signal(&ksig))
continue;
- break;
+ if (fatal_signal_pending(current))
+ break;
+ continue;
}
if (ret)
continue;
--
2.34.1