提交 41be53e9 编写于 作者: J Jens Axboe

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: NJens Axboe <axboe@kernel.dk>
上级 9a4fdbd8
...@@ -9232,8 +9232,10 @@ static int io_uring_flush(struct file *file, void *data) ...@@ -9232,8 +9232,10 @@ static int io_uring_flush(struct file *file, void *data)
struct io_uring_task *tctx = current->io_uring; struct io_uring_task *tctx = current->io_uring;
struct io_ring_ctx *ctx = file->private_data; 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_uring_cancel_task_requests(ctx, NULL);
io_req_caches_free(ctx, current);
}
if (!tctx) if (!tctx)
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册