From: Jens Axboe Date: Sat, 13 Feb 2021 16:11:04 +0000 (-0700) Subject: io_uring: kill cached requests from exiting task closing the ring X-Git-Tag: accepted/tizen/unified/20230118.172025~7716^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41be53e94fb04cc69fdf2f524c2a05d8069e047b;p=platform%2Fkernel%2Flinux-rpi.git io_uring: kill cached requests from exiting task closing the ring Be nice and prune these upfront, in case the ring is being shared and one of the tasks is going away. This is a bit more important now that we account the allocations. Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 1895fc1..a9d094f 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -9232,8 +9232,10 @@ static int io_uring_flush(struct file *file, void *data) struct io_uring_task *tctx = current->io_uring; struct io_ring_ctx *ctx = file->private_data; - if (fatal_signal_pending(current) || (current->flags & PF_EXITING)) + if (fatal_signal_pending(current) || (current->flags & PF_EXITING)) { io_uring_cancel_task_requests(ctx, NULL); + io_req_caches_free(ctx, current); + } if (!tctx) return 0;