diff -purN -X /home/mbligh/.diff.exclude 697-lockmeter_tytso/fs/aio.c 698-aiofix2/fs/aio.c
--- 697-lockmeter_tytso/fs/aio.c	2003-07-28 15:32:58.000000000 -0700
+++ 698-aiofix2/fs/aio.c	2003-07-28 19:03:43.000000000 -0700
@@ -204,6 +204,7 @@ static struct kioctx *ioctx_alloc(unsign
 {
 	struct mm_struct *mm;
 	struct kioctx *ctx;
+	int ret = 0;
 
 	/* Prevent overflows */
 	if ((nr_events > (0x10000000U / sizeof(struct io_event))) ||
@@ -233,7 +234,8 @@ static struct kioctx *ioctx_alloc(unsign
 	INIT_LIST_HEAD(&ctx->run_list);
 	INIT_WORK(&ctx->wq, aio_kick_handler, ctx);
 
-	if (aio_setup_ring(ctx) < 0)
+	ret = aio_setup_ring(ctx);
+	if (unlikely(ret < 0))
 		goto out_freectx;
 
 	/* limit the number of system wide aios */
@@ -259,7 +261,7 @@ out_cleanup:
 
 out_freectx:
 	kmem_cache_free(kioctx_cachep, ctx);
-	ctx = ERR_PTR(-ENOMEM);
+	ctx = ERR_PTR(ret);
 
 	dprintk("aio: error allocating ioctx %p\n", ctx);
 	return ctx;