summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/aio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/aio.c b/fs/aio.c
index ce0818223dc9..d72588a4c935 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -797,6 +797,9 @@ void exit_aio(struct mm_struct *mm)
unsigned i = 0;
while (1) {
+ struct completion requests_done =
+ COMPLETION_INITIALIZER_ONSTACK(requests_done);
+
rcu_read_lock();
table = rcu_dereference(mm->ioctx_table);
@@ -824,7 +827,10 @@ void exit_aio(struct mm_struct *mm)
*/
ctx->mmap_size = 0;
- kill_ioctx(mm, ctx, NULL);
+ kill_ioctx(mm, ctx, &requests_done);
+
+ /* Wait until all IO for the context are done. */
+ wait_for_completion(&requests_done);
}
}