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

From: John Myers (jgmyers@netscape.com)
Date: Wed Jun 18 2003 - 19:58:45 EST


Joel Becker wrote:

> The slippery slope isn't important. POSIX specifies EAGAIN (you concede that), EBADF, and EINVAL against nbytes|offset|reqprio.
>The kernel does these checks already (where applicable).
>
EAGAIN doesn't require user space to fire any per-operation callbacks or
take any per-operation action. One merely needs to retry the io_submit().

The existing EBADF and EFAULT conditions indicate buggy code. Correctly
written programs will never encounter these. An appropriate action is
to assert or otherwise shut down the entire process. Similarly for
EINVAL against the reserved fields, aio_buf, and nbytes. I'll also
grant that EINVAL against offset and reqprio would also indicate buggy code.

EINVAL caused by a fd that doesn't support the particular opcode could
be encountered by a correctly written program which is given the wrong
sort of file by a user. I would prefer such errors be reported through
io_getevents() so they can be handled by the operation's callback/event
handling code.



-
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/



This archive was generated by hypermail 2b29 : Mon Jun 23 2003 - 22:00:27 EST