From: akpm@linux-foundation.org Date: Mon, 16 Jul 2007 06:38:25 +0000 (-0700) Subject: NeilBrown X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c44939ecb6e05aeaaf12d4e1bb046719c97e457e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git NeilBrown The do_loop_readv_writev implementation of readv breaks out of the loop as soon as a single read request didn't fill it's buffer: if (nr != len) break; The generic_file_aio_read version doesn't. So if it hits EOF before the end of the list of buffers, it will try again on the next buffer. If the file was extended in the mean time, this will produce a bad result. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/filemap.c b/mm/filemap.c index e006c57bda54..adbac104f34c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1219,6 +1219,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov, retval = retval ?: desc.error; break; } + if (desc.count > 0) + break; } } out: