]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix regression with always ignoring signals in io_cqring_wait()
authorJens Axboe <axboe@kernel.dk>
Sat, 4 Jul 2020 14:55:50 +0000 (08:55 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 4 Jul 2020 19:44:45 +0000 (13:44 -0600)
commit8de29f1688719422ca73080d0535b02001a49c97
tree66de3253898e9fc1128e7c7e7ed326bfd378ff9b
parent4e752236926c45b6fad8636f9f45fe593cf3a788
io_uring: fix regression with always ignoring signals in io_cqring_wait()

When switching to TWA_SIGNAL for task_work notifications, we also made
any signal based condition in io_cqring_wait() return -ERESTARTSYS.
This breaks applications that rely on using signals to abort someone
waiting for events.

Check if we have a signal pending because of queued task_work, and
repeat the signal check once we've run the task_work. This provides a
reliable way of telling the two apart.

Additionally, only use TWA_SIGNAL if we are using an eventfd. If not,
we don't have the dependency situation described in the original commit,
and we can get by with just using TWA_RESUME like we previously did.

Fixes: 4e752236926c ("io_uring: use signal based task_work running")
Cc: stable@vger.kernel.org # v5.7
Reported-by: Andres Freund <andres@anarazel.de>
Tested-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c