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

John Myers
2003-06-19T00:44:53Z

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

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.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3941 bytes --]