]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] Direct IO async short read fix
authorDaniel McNeil <daniel@osdl.org>
Sat, 16 Apr 2005 22:25:50 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:25:50 +0000 (15:25 -0700)
commite8e0d7ec1b69b012e7744cc5f719f890552b9b44
treea2038598eafafd40bfc9a6147c57c242d23194be
parent234757a4d9f168046361980197af456771b4b1d6
[PATCH] Direct IO async short read fix

The direct I/O code is mapping the read request to the file system block.  If
the file size was not on a block boundary, the result would show the the read
reading past EOF.  This was only happening for the AIO case.  The non-AIO case
truncates the result to match file size (in direct_io_worker).  This patch
does the same thing for the AIO case, it truncates the result to match the
file size if the read reads past EOF.

When I/O completes the result can be truncated to match the file size
without using i_size_read(), thus the aio result now matches the number of
bytes read to the end of file.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/direct-io.c