Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25.2 /fs/aio.c

Filename:/fs/aio.c
Lines Added:11
Lines Deleted:1
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25.1  2.6.25-git18  2.6.25-git17  2.6.25-git16 
(Following) 2.6.25.3  2.6.25.4  2.6.25.5  2.6.25.6  2.6.25.7  2.6.25.8 

Location
[  2.6.25.2
  [  fs
     o  aio.c

Patch

diff --git a/fs/aio.c b/fs/aio.c
index 2283686..ae94e1d 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1166,7 +1166,10 @@ retry:
             break;
          if (min_nr <= i)
             break;
-         ret = 0;
+         if (unlikely(ctx->dead)) {
+            ret = -EINVAL;
+            break;
+         }
          if (to.timed_out)   /* Only check after read evt */
             break;
          /* Try to only show up in io wait if there are ops
@@ -1231,6 +1234,13 @@ static void io_destroy(struct kioctx *ioctx)
 
    aio_cancel_all(ioctx);
    wait_for_all_aios(ioctx);
+
+   /*
+    * Wake up any waiters.  The setting of ctx->dead must be seen
+    * by other CPUs at this point.  Right now, we rely on the
+    * locking done by the above calls to ensure this consistency.
+    */
+   wake_up(&ioctx->wait);
    put_ioctx(ioctx);   /* once for the lookup */
 }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.