Commit 78f8876c authored by Jens Axboe's avatar Jens Axboe

io-wq: exclusively gate signal based exit on get_signal() return

io-wq threads block all signals, except SIGKILL and SIGSTOP. We should not
need any extra checking of signal_pending or fatal_signal_pending, rely
exclusively on whether or not get_signal() tells us to exit.

The original debugging of this issue led to the false positive that we
were exiting on non-fatal signals, but that is not the case. The issue
was around races with nr_workers accounting.

Fixes: 87c16966 ("io-wq: ensure we exit if thread group is exiting")
Fixes: 15e20db2 ("io-wq: only exit on fatal signals")
Reported-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7df778be
...@@ -584,10 +584,7 @@ static int io_wqe_worker(void *data) ...@@ -584,10 +584,7 @@ static int io_wqe_worker(void *data)
if (!get_signal(&ksig)) if (!get_signal(&ksig))
continue; continue;
if (fatal_signal_pending(current) ||
signal_group_exit(current->signal))
break; break;
continue;
} }
last_timeout = !ret; last_timeout = !ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment