Re: [PATCH 2.5.71-mm1] aio process hang on EINVAL

Joel Becker (jlbec@evilplan.org)
Wed, 18 Jun 2003 01:15:34 +0100


On Tue, Jun 17, 2003 at 05:03:36PM -0700, John Myers wrote:
> >I prefer getting the error on io_submit.
> >
> >
> I prefer getting the error on io_getevents(). The code that handles the

POSIX 1003.1 says this about aio_read() and aio_write():

If an error condition is encountered during queuing, the function
call shall return without having initiated or queued the request.

If you intend to ever allow a POSIX wrapper to these interfaces (I have
one, for instance), you need to return EINVAL, EBADF, and the like from
io_submit(). Note that io_submit() has read-like semantics, so an
additional call may be necessary if some iocbs were successfully queued.

A user has to handle EAGAIN, so io_submit() cannot return void, and you
already have error handling logic here.

Joel

-- 

"Born under a bad sign. I been down since I began to crawl. If it wasn't for bad luck, I wouldn't have no luck at all."

http://www.jlbec.org/ jlbec@evilplan.org - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/