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

John Myers
2003-06-17T18:17:36Z

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

Suparna Bhattacharya wrote:

>The right way to implement aio poll in
>the new model would have been to setup a retry method for it
>in aio_setup_iocb(), not run generic_aio_poll() directly there.
>
>
That seems unnecessarily indirect and complicated. It also adds
additional cases for the cancellation path, furthur adding to
complexity. The aio poll mechanism is perfectly capable of arranging
callbacks itself.

The check should be:

if (-EIOCBQUEUED == ret)
return 0;
if (unlikely(ret))
goto out_put_req;

Then handling of immediate completion should be inside either
aio_setup_iocb() or generic_aio_poll(), resulting in a call to
aio_complete() and a return from aio_setup_iocb() of -EIOCBQUEUED.

On another point, I certainly don't like the way aio_run_iocb()
unconditionally completes with -EINTR on cancellation. A cancelled
read/write should return the number of bytes transferred.

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