Re: [PATCH linux-2.6.1-rc1-mm1] aiodio_fallback_bio_count.patch

From: Andrew Morton
Date: Mon Jan 05 2004 - 00:07:58 EST


Suparna Bhattacharya <suparna@xxxxxxxxxx> wrote:
>
> > What is the significance of `written > count' in there, and of `dio->result
> > > dio->size' in finished_one_bio()? How can these states come about?
> >
>
> Both of these are checks to determine whether all or only a part of
> the request was serviced by DIO, leaving the rest to be serviced by
> falling back to buffered I/O.
>
> Earlier, we would decide this based on whether dio->result == -ENOTBLK
> and written == -ENOTBLK respectively. However, now that we also need the
> result to indicate how much actually got written even in -ENOTBLK case,
> so that we can issue buffered i/o only for the remaining part of the request,
> dio->result and written had to be modified to reflect the number of bytes
> transferred by DIO even for the fallback to buffered i/o case.
> So we need checks like this to find out whether there is some i/o left
> to be issued via buffered i/o.

Sure. But the generic_file_aio_write_nolock() code is doing this:

if (written >= count && !is_sync_kiocb(iocb))
written = -EIOCBQUEUED;
if (written < 0 || written >= count)
goto out_status;


Under what circumstances can `written' (the amount which was written) be
greater than `count' (the amount to write)?
-
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/