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