public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.5.71-mm1] aio process hang on EINVAL
@ 2003-06-17  0:43 Daniel McNeil
  2003-06-17  1:33 ` John Myers
  0 siblings, 1 reply; 16+ messages in thread
From: Daniel McNeil @ 2003-06-17  0:43 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel Mailing List, linux-aio@kvack.org

[-- Attachment #1: Type: text/plain, Size: 654 bytes --]

Andrew,

Here is a patch to fix EINVAL handling in io_submit_one() that was
causing a process hang when attempting AIO to a device not able
to handle aio.  I hit this doing a AIO read from /dev/zero.  The
process would hang on exit in wait_for_all_aios().  The fix is
to check for EINVAL coming back from aio_setup_iocb() in addition
to the EFAULT and EBADF already there.  This causes the io_submit
to fail with EINVAL.  That check looks error prone.
Are there other error return values where it should jump to the
aio_put_req()?  Should the check be:

	if (ret != 0 && ret != -EIOCBQUEUED)
		goto out_put_req;

Thanks,

Daniel McNeil <daniel@osdl.org>

[-- Attachment #2: patch.2.5.71-mm1.aio --]
[-- Type: text/x-patch, Size: 512 bytes --]

diff -rupN -X /home/daniel_nfs/dontdiff linux-2.5.71-mm1/fs/aio.c linux-2.5.71-mm1.patch/fs/aio.c
--- linux-2.5.71-mm1/fs/aio.c	2003-06-16 15:17:22.000000000 -0700
+++ linux-2.5.71-mm1.patch/fs/aio.c	2003-06-16 16:46:27.515255621 -0700
@@ -1504,7 +1504,7 @@ int io_submit_one(struct kioctx *ctx, st
 
 	ret = aio_setup_iocb(req, iocb);
 
-	if ((-EBADF == ret) || (-EFAULT == ret))
+	if ((-EBADF == ret) || (-EFAULT == ret) || (-EINVAL == ret))
 		goto out_put_req;
 
 	spin_lock_irq(&ctx->ctx_lock);

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2003-06-19 22:27 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-17  0:43 [PATCH 2.5.71-mm1] aio process hang on EINVAL Daniel McNeil
2003-06-17  1:33 ` John Myers
2003-06-17  3:24   ` Suparna Bhattacharya
2003-06-17 18:31     ` John Myers
2003-06-17 21:06     ` Daniel McNeil
2003-06-18  0:03       ` John Myers
2003-06-18  0:15         ` Joel Becker
2003-06-18  0:25           ` John Myers
2003-06-18  0:42             ` Joel Becker
2003-06-19  0:33               ` John Myers
2003-06-19  0:41                 ` Joel Becker
2003-06-19  0:58                   ` John Myers
2003-06-19  1:48                 ` Scot McKinley
2003-06-19 20:54                   ` John Myers
2003-06-19 22:42                     ` Scot McKinley
2003-06-18  5:11         ` Scot McKinley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox