Re: O_DIRECT broken in 2.5.3-preX ?

From: Andrea Arcangeli (andrea@suse.de)
Date: Sun Jan 27 2002 - 21:06:11 EST


On Thu, Jan 24, 2002 at 01:52:04PM -0800, Badari Pulavarty wrote:
> Hi,
>
> I am reading the O_DIRECT code patch for 2.5.3-pre4. I was wondering
> how is this working in 2.5.X ? Here is my concern:
>
> generic_direct_IO() creates a blocks[] list and passes it to
> brw_kiovec() with a single kiobuf.
>
> retval = brw_kiovec(rw, 1, &iobuf, inode->i_dev, blocks, blocksize);
>
> But brw_kiovec() uses only b[0] to call ll_rw_bio().
>
> for (i = 0; i < nr; i++) {
> iobuf = iovec[i];
> iobuf->errno = 0;
>
> ll_rw_kio(rw, iobuf, dev, b[i] * (size >> 9));
> }
>
>
> Note that nr = 1 here. ll_rw_kio() uses b[0] as starting sector
> and does the entire IO (for iobuf->length). This is wrong !!!
> It is doing IO from wrong blocks. Some one should use other
> block numbers from blocks[] list. Isn't it ?

correct. It seems like somebody broke the semantics of the block field
of brw_kiovec without updating the callers, and furthmore now it is
impossible to use brw_kiovec for O_DIRECT because it is not going to
submit physically contigous I/O.

Andrea
-
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 : Thu Jan 31 2002 - 21:00:46 EST