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

Joel Becker
2003-06-18T00:01:43Z

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