Re: [PATCH 2.6-bk] aio not returning error code(?)

From: Benjamin LaHaise
Date: Wed Jul 07 2004 - 17:34:15 EST


On Wed, Jul 07, 2004 at 02:42:44PM +0100, Anton Altaparmakov wrote:
> --- bklinux-2.6/fs/aio.c 2004-07-01 11:19:35.000000000 +0100
> +++ bklinux-2.6/fs/aio.c.new 2004-07-07 14:26:19.445631304 +0100
> @@ -1086,7 +1086,7 @@ int fastcall io_submit_one(struct kioctx
> if (likely(-EIOCBQUEUED == ret))
> return 0;
> aio_complete(req, ret, 0); /* will drop i/o ref to req */
> - return 0;
> + return ret;

That's wrong: you now get 2 results for the same operation -- an error on
the submit, and an event with a return code. In order for the user code
to do the right thing, you must only get one or the other. If io_submit
fails for a particular iocb, there must be no event returned.

-ben
--
"Time is what keeps everything from happening all at once." -- John Wheeler
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/