This is a note to let you know that I've just added the patch titled io_uring: perform IOPOLL reaping if canceler is thread itself to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-perform-iopoll-reaping-if-canceler-is-threa.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 69d995c93c566a771c0da42497eef13d1ffe71d2 Author: Jens Axboe <axboe@xxxxxxxxx> Date: Thu Mar 11 10:49:20 2021 -0700 io_uring: perform IOPOLL reaping if canceler is thread itself [ Upstream commit d052d1d685f5125249ab4ff887562c88ba959638 ] We bypass IOPOLL completion polling (and reaping) for the SQPOLL thread, but if it's the thread itself invoking cancelations, then we still need to perform it or no one will. Fixes: 9936c7c2bc76 ("io_uring: deduplicate core cancellations sequence") Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/io_uring.c b/fs/io_uring.c index 241313278e5a..00ef0b90d149 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8891,7 +8891,8 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx, } /* SQPOLL thread does its own polling */ - if (!(ctx->flags & IORING_SETUP_SQPOLL) && !files) { + if ((!(ctx->flags & IORING_SETUP_SQPOLL) && !files) || + (ctx->sq_data && ctx->sq_data->thread == current)) { while (!list_empty_careful(&ctx->iopoll_list)) { io_iopoll_try_reap_events(ctx); ret = true;