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>
This commit is contained in:
parent
b9b0e0d39c
commit
45ab03b19e
@ -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;
|
struct io_ring_ctx *ctx = req->ctx;
|
||||||
|
|
||||||
|
if (!error && req->poll.canceled)
|
||||||
|
error = -ECANCELED;
|
||||||
|
|
||||||
io_poll_remove_double(req);
|
io_poll_remove_double(req);
|
||||||
req->poll.done = true;
|
req->poll.done = true;
|
||||||
io_cqring_fill_event(req, error ? error : mangle_poll(mask));
|
io_cqring_fill_event(req, error ? error : mangle_poll(mask));
|
||||||
|
Loading…
Reference in New Issue
Block a user