From: Josef Bacik <jbacik@redhat.com> Date: Tue, 10 Feb 2009 13:49:27 -0500 Subject: [fs] splice: dont do readpage Message-id: 1234291777-15344-15-git-send-email-jbacik@redhat.com O-Subject: [PATCH 14/24] [RHEL 5.4] splice: dont do readpage Bugzilla: 445433 RH-Acked-by: Steven Whitehouse <swhiteho@redhat.com> RH-Acked-by: Jeff Layton <jlayton@redhat.com> This is a backport of upstream commit 08c72591636829d40bd695d43ec6d2a8191b668b and is in reference to bz 445433. This just pulls out the readpage before prepare_write, since prepare_write should take care of that. Signed-off-by: Josef Bacik <jbacik@redhat.com> diff --git a/fs/splice.c b/fs/splice.c index 3082a71..fc43925 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -593,36 +593,6 @@ find_page: goto out_release; } - /* - * 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);