Commit 6098b45b authored by Gu Zheng's avatar Gu Zheng Committed by Benjamin LaHaise
Browse files

aio: block exit_aio() until all context requests are completed

It seems that exit_aio() also needs to wait for all iocbs to complete (like
io_destroy), but we missed the wait step in current implemention, so fix
it in the same way as we did in io_destroy.

Signed-off-by: default avatarGu Zheng <>
Signed-off-by: default avatarBenjamin LaHaise <>
parent 2ff396be
......@@ -793,6 +793,8 @@ void exit_aio(struct mm_struct *mm)
for (i = 0; i < table->nr; ++i) {
struct kioctx *ctx = table->table[i];
struct completion requests_done =
if (!ctx)
......@@ -804,7 +806,10 @@ void exit_aio(struct mm_struct *mm)
* that it needs to unmap the area, just set it to 0.
ctx->mmap_size = 0;
kill_ioctx(mm, ctx, NULL);
kill_ioctx(mm, ctx, &requests_done);
/* Wait until all IO for the context are done. */
RCU_INIT_POINTER(mm->ioctx_table, NULL);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment