Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c44939ecb6e05aeaaf12d4e1bb046719c97e457e
Commit:     c44939ecb6e05aeaaf12d4e1bb046719c97e457e
Parent:     5ed44a401ddfc60e11c3484e86f0c8285051139a
Author:     [EMAIL PROTECTED] <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 15 23:38:25 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 09:05:37 2007 -0700

    NeilBrown <[EMAIL PROTECTED]>
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/filemap.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index e006c57..adbac10 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:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to