提交 a226abcd 编写于 作者: J Jens Axboe

io-wq: don't retry task_work creation failure on fatal conditions

We don't want to be retrying task_work creation failure if there's
an actual signal pending for the parent task. If we do, then we can
enter an infinite loop of perpetually retrying and each retry failing
with -ERESTARTNOINTR because a signal is pending.

Fixes: 3146cba9 ("io-wq: make worker creation resilient against signals")
Reported-by: NFlorian Fischer <florian.fl.fischer@fau.de>
Link: https://lore.kernel.org/io-uring/20211202165606.mqryio4yzubl7ms5@pasture/Tested-by: NFlorian Fischer <florian.fl.fischer@fau.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 f6223ff7
...@@ -714,6 +714,13 @@ static bool io_wq_work_match_all(struct io_wq_work *work, void *data) ...@@ -714,6 +714,13 @@ static bool io_wq_work_match_all(struct io_wq_work *work, void *data)
static inline bool io_should_retry_thread(long err) static inline bool io_should_retry_thread(long err)
{ {
/*
* Prevent perpetual task_work retry, if the task (or its group) is
* exiting.
*/
if (fatal_signal_pending(current))
return false;
switch (err) { switch (err) {
case -EAGAIN: case -EAGAIN:
case -ERESTARTSYS: case -ERESTARTSYS:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册