lkml.org 
[lkml]   [2004]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2.6-bk] aio not returning error code(?)
Hello Anton,

On Thu, Jul 08, 2004 at 01:56:24PM +0100, Anton Altaparmakov wrote:
> You are saying that this is wrong and that no error code is returned
> from io_submit despite its manpage saying that it is so one of the two
> must be wrong, no?

Either or. Yes, the man page needs to talk about early vs late errors
(remember that any early error for a given iocb is valid late), or your
patch needs to be fixed. Something like the following would be the
right way of fixing it -- it doesn't report the same error twice (both
early and late) as your patch did, but it's not clear which was is better.
There are good arguements in favour of both early and late error
reporting, and late errors must always be handled by the application. I
hope this clears things up to the level of mud. ;-) Cheers,

-ben
--
"Time is what keeps everything from happening all at once." -- John Wheeler


--- fs/aio.c.orig 2004-07-08 09:18:02.208534208 -0400
+++ fs/aio.c 2004-07-08 09:23:42.346825328 -0400
@@ -1044,6 +1044,8 @@
if (file->f_op->aio_read)
ret = file->f_op->aio_read(req, buf,
iocb->aio_nbytes, req->ki_pos);
+ else
+ goto out_put_req;
break;
case IOCB_CMD_PWRITE:
ret = -EBADF;
@@ -1059,20 +1061,27 @@
if (file->f_op->aio_write)
ret = file->f_op->aio_write(req, buf,
iocb->aio_nbytes, req->ki_pos);
+ else
+ goto out_put_req;
break;
case IOCB_CMD_FDSYNC:
ret = -EINVAL;
if (file->f_op->aio_fsync)
ret = file->f_op->aio_fsync(req, 1);
+ else
+ goto out_put_req;
break;
case IOCB_CMD_FSYNC:
ret = -EINVAL;
if (file->f_op->aio_fsync)
ret = file->f_op->aio_fsync(req, 0);
+ else
+ goto out_put_req;
break;
default:
dprintk("EINVAL: io_submit: no operation provided\n");
ret = -EINVAL;
+ goto out_put_req;
}

aio_put_req(req); /* drop extra ref to req */
-
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/
\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.536 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site