diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-07-04 08:55:50 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-09 09:39:36 +0200 |
commit | b5f92c3eccab823a12b1868e10feac74c7d67f5d (patch) | |
tree | 66c55a14c3fa138a5b19a41fa698417e54bcb9ae /drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | |
parent | 92e13371c255402efc96effe5e6afaebd0f0314c (diff) |
io_uring: fix regression with always ignoring signals in io_cqring_wait()
[ Upstream commit b7db41c9e03b5189bc94993bd50e4506ac9e34c1 ]
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: ce593a6c480a ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c')
0 files changed, 0 insertions, 0 deletions