aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorakpm@linux-foundation.org <akpm@linux-foundation.org>2007-07-16 02:38:25 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:37 -0400
commitc44939ecb6e05aeaaf12d4e1bb046719c97e457e (patch)
tree5bf1bc2c4c518fb89271110a0e9fbb43d6f4c413 /mm/filemap.c
parent5ed44a401ddfc60e11c3484e86f0c8285051139a (diff)
NeilBrown <neilb@suse.de>
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 <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c2
1 files changed, 2 insertions, 0 deletions
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,
1219 retval = retval ?: desc.error; 1219 retval = retval ?: desc.error;
1220 break; 1220 break;
1221 } 1221 }
1222 if (desc.count > 0)
1223 break;
1222 } 1224 }
1223 } 1225 }
1224out: 1226out: