Messages in this thread | | | Date | Wed, 18 Jun 2003 17:58:45 -0700 | From | (John Myers) | Subject | Re: [PATCH 2.5.71-mm1] aio process hang on EINVAL |
| |
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.
[unhandled content-type:application/x-pkcs7-signature] | |