From: Jens Axboe Date: Tue, 23 Feb 2021 15:19:33 +0000 (-0700) Subject: io_uring: transform ret == 0 for poll cancelation completions X-Git-Tag: for-5.13/io_uring-2021-04-27~138 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=45ab03b19e8bf33af3e5f5a24729e5564d54fae9;p=linux-block.git 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 --- 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));