summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-23 08:19:33 -0700
committerJens Axboe <axboe@kernel.dk>2021-04-11 17:41:58 -0600
commit45ab03b19e8bf33af3e5f5a24729e5564d54fae9 (patch)
treecdbfb3066e63aec2716859ff5251c16f62bbff72 /fs/io_uring.c
parentb9b0e0d39c7b4be7af7976c52bdb8664dfa389f5 (diff)
downloadlwn-45ab03b19e8bf33af3e5f5a24729e5564d54fae9.tar.gz
lwn-45ab03b19e8bf33af3e5f5a24729e5564d54fae9.zip
io_uring: transform ret == 0 for poll cancelation completions
We can set canceled == true and complete out-of-line, ensure that we catch that and correctly return -ECANCELED if the poll operation got canceled. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 13d087ebe057..962a3580c49f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4955,6 +4955,9 @@ static void io_poll_complete(struct io_kiocb *req, __poll_t mask, int error)
{
struct io_ring_ctx *ctx = req->ctx;
+ if (!error && req->poll.canceled)
+ error = -ECANCELED;
+
io_poll_remove_double(req);
req->poll.done = true;
io_cqring_fill_event(req, error ? error : mangle_poll(mask));