Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 3211

kernel-2.6.18-194.11.1.el5.src.rpm

From: Hans-Joachim Picht <hpicht@redhat.com>
Date: Thu, 12 Mar 2009 15:25:56 +0100
Subject: [s390] splice: handle try_to_release_page failure
Message-id: 20090312142556.GN5103@redhat.com
O-Subject: [RHEL5 U4 PATCH 13/20] FEAT: s390 : splice: handle try_to_release_page() failure
Bugzilla: 475334

Bugzilla:
---------

BZ 475334
https://bugzilla.redhat.com/show_bug.cgi?id=475334

commit ca39d651d17df49b6d11f851d56c0ce0ce01ea1a
Author: Jens Axboe <jens.axboe@oracle.com>
Date:   Tue May 20 21:27:41 2008 +0200

    splice: handle try_to_release_page() failure

    splice currently assumes that try_to_release_page() always suceeds,
    but it can return failure. If it does, we cannot steal the page.

diff --git a/fs/splice.c b/fs/splice.c
index 72dffa6..361d52a 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -73,8 +73,9 @@ static int page_cache_pipe_buf_steal(struct pipe_inode_info *pipe,
 		 */
 		wait_on_page_writeback(page);
 
-		if (PagePrivate(page))
-			try_to_release_page(page, GFP_KERNEL);
+		if (PagePrivate(page)
+		    && try_to_release_page(page, GFP_KERNEL))
+			goto out_unlock;
 
 		/*
 		 * If we succeeded in removing the mapping, set LRU flag
@@ -90,6 +91,7 @@ static int page_cache_pipe_buf_steal(struct pipe_inode_info *pipe,
 	 * Raced with truncate or failed to remove page from current
 	 * address space, unlock and return failure.
 	 */
+out_unlock:
 	unlock_page(page);
 	return 1;
 }