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

From: John Myers (jgmyers@netscape.com)
Date: Tue Jun 17 2003 - 13:31:12 EST


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.



-
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:21 EST