From: Suparna Bhattacharya <suparna@in.ibm.com>

Flush out the workqueue before destroying the ioctx which may be sitting on
it.


 fs/aio.c |   10 ++++++++++
 1 files changed, 10 insertions(+)

diff -puN fs/aio.c~aio-11-workqueue-flush fs/aio.c
--- 25/fs/aio.c~aio-11-workqueue-flush	2003-06-16 23:16:42.000000000 -0700
+++ 25-akpm/fs/aio.c	2003-06-16 23:16:42.000000000 -0700
@@ -346,6 +346,11 @@ void exit_aio(struct mm_struct *mm)
 		aio_cancel_all(ctx);
 
 		wait_for_all_aios(ctx);
+		/* 
+		 * this is an overkill, but ensures we don't leave 
+		 * the ctx on the aio_wq
+		 */
+		flush_workqueue(aio_wq);
 
 		if (1 != atomic_read(&ctx->users))
 			printk(KERN_DEBUG
@@ -1147,6 +1152,11 @@ static void io_destroy(struct kioctx *io
 
 	aio_cancel_all(ioctx);
 	wait_for_all_aios(ioctx);
+	/* 
+	 * this is an overkill, but ensures we don't leave 
+	 * the ctx on the aio_wq
+	 */
+	flush_workqueue(aio_wq);
 	put_ioctx(ioctx);	/* once for the lookup */
 }
 

_