This is a note to let you know that I've just added the patch titled

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

to the 3.16-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     aio-block-exit_aio-until-all-context-requests-are-completed.patch
and it can be found in the queue-3.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 6098b45b32e6baeacc04790773ced9340601d511 Mon Sep 17 00:00:00 2001
From: Gu Zheng <[email protected]>
Date: Wed, 3 Sep 2014 17:45:44 +0800
Subject: aio: block exit_aio() until all context requests are completed

From: Gu Zheng <[email protected]>

commit 6098b45b32e6baeacc04790773ced9340601d511 upstream.

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: Gu Zheng <[email protected]>
Signed-off-by: Benjamin LaHaise <[email protected]>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <[email protected]>

---
 fs/aio.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- 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);
        }
 }
 


Patches currently in stable-queue which might be from [email protected] 
are

queue-3.16/aio-block-exit_aio-until-all-context-requests-are-completed.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to