Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08c72591636829d40bd695d43ec6d2a8191b668b
Commit:     08c72591636829d40bd695d43ec6d2a8191b668b
Parent:     485ddb4b9741bafb70b22e5c1f9b4f37dc3e85bd
Author:     Nick Piggin <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 27 08:55:39 2007 +0200
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Mar 27 08:55:39 2007 +0200

    2/2 splice: dont readpage
    
    Splice does not need to readpage to bring the page uptodate before writing
    to it, because prepare_write will take care of that for us.
    
    Splice is also wrong to SetPageUptodate before the page is actually 
uptodate.
    This results in the old uninitialised memory leak. This gets fixed as a
    matter of course when removing the readpage logic.
    
    Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 fs/splice.c |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)

diff --git a/fs/splice.c b/fs/splice.c
index badc78f..ae50208 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -593,36 +593,6 @@ find_page:
                        goto out;
        }
 
-       /*
-        * We get here with the page locked. If the page is also
-        * uptodate, we don't need to do more. If it isn't, we
-        * may need to bring it in if we are not going to overwrite
-        * the full page.
-        */
-       if (!PageUptodate(page)) {
-               if (this_len < PAGE_CACHE_SIZE) {
-                       ret = mapping->a_ops->readpage(file, page);
-                       if (unlikely(ret))
-                               goto out;
-
-                       lock_page(page);
-
-                       if (!PageUptodate(page)) {
-                               /*
-                                * Page got invalidated, repeat.
-                                */
-                               if (!page->mapping) {
-                                       unlock_page(page);
-                                       page_cache_release(page);
-                                       goto find_page;
-                               }
-                               ret = -EIO;
-                               goto out;
-                       }
-               } else
-                       SetPageUptodate(page);
-       }
-
        ret = mapping->a_ops->prepare_write(file, page, offset, 
offset+this_len);
        if (unlikely(ret)) {
                loff_t isize = i_size_read(mapping->host);
-
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