lkml.org 
[lkml]   [2012]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] mm: shmem: unlock valid page
From
In shmem_read_mapping_page_gfp() page is unlocked if no error returned,
so the unlocked page has to valid.

To guarantee that validity, when getting page, success result is feed
back to caller only when page is valid.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/mm/shmem.c Sun Mar 4 12:17:42 2012
+++ b/mm/shmem.c Sun Mar 4 12:26:56 2012
@@ -889,13 +889,13 @@ repeat:
goto failed;
}

- if (page || (sgp == SGP_READ && !swap.val)) {
+ if (page) {
/*
* Once we can get the page lock, it must be uptodate:
* if there were an error in reading back from swap,
* the page would not be inserted into the filecache.
*/
- BUG_ON(page && !PageUptodate(page));
+ BUG_ON(!PageUptodate(page));
*pagep = page;
return 0;
}
--

\
 
 \ /
  Last update: 2012-03-04 06:19    [W:0.042 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site