diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-08-18 13:42:45 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-23 21:13:04 +0200 |
commit | 5636c00d3e8ef1f6d1291e71edb48f727ba5a999 (patch) | |
tree | d7f83f422bf02bb67e72b22e0281ba50c81604d3 /fs/io_uring.c | |
parent | io_uring: add ->splice_fd_in checks (diff) | |
download | linux-5636c00d3e8ef1f6d1291e71edb48f727ba5a999.tar.xz linux-5636c00d3e8ef1f6d1291e71edb48f727ba5a999.zip |
io_uring: flush completions for fallbacks
io_fallback_req_func() doesn't expect anyone creating inline
completions, and no one currently does that. Teach the function to flush
completions preparing for further changes.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/8b941516921f72e1a64d58932d671736892d7fff.1629286357.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 3898f7ab14f6..926df5b00b31 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1197,6 +1197,11 @@ static void io_fallback_req_func(struct work_struct *work) percpu_ref_get(&ctx->refs); llist_for_each_entry_safe(req, tmp, node, io_task_work.fallback_node) req->io_task_work.func(req); + + mutex_lock(&ctx->uring_lock); + if (ctx->submit_state.compl_nr) + io_submit_flush_completions(ctx); + mutex_unlock(&ctx->uring_lock); percpu_ref_put(&ctx->refs); } |