aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2007-11-28 13:55:10 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-11-28 14:04:28 -0500
commite84e2e132c9c66d8498e7710d4ea532d1feaaac5 (patch)
treef754be23d6b37af04d203eb6e34ac7cdb5f84a4b /mm/shmem.c
parent9bfb52ad716e74785b2402b7ea17f30e0344b8e8 (diff)
tmpfs: restore missing clear_highpage
tmpfs was misconverted to __GFP_ZERO in 2.6.11. There's an unusual case in which shmem_getpage receives the page from its caller instead of allocating. We must cover this case by clear_highpage before SetPageUptodate, as before. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 253d205914ba..51b3d6ccddab 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1072,7 +1072,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem_inode_info *info,
1072 pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx); 1072 pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx);
1073 pvma.vm_pgoff = idx; 1073 pvma.vm_pgoff = idx;
1074 pvma.vm_end = PAGE_SIZE; 1074 pvma.vm_end = PAGE_SIZE;
1075 page = alloc_page_vma(gfp | __GFP_ZERO, &pvma, 0); 1075 page = alloc_page_vma(gfp, &pvma, 0);
1076 mpol_free(pvma.vm_policy); 1076 mpol_free(pvma.vm_policy);
1077 return page; 1077 return page;
1078} 1078}
@@ -1093,7 +1093,7 @@ shmem_swapin(struct shmem_inode_info *info,swp_entry_t entry,unsigned long idx)
1093static inline struct page * 1093static inline struct page *
1094shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx) 1094shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx)
1095{ 1095{
1096 return alloc_page(gfp | __GFP_ZERO); 1096 return alloc_page(gfp);
1097} 1097}
1098#endif 1098#endif
1099 1099
@@ -1306,6 +1306,7 @@ repeat:
1306 1306
1307 info->alloced++; 1307 info->alloced++;
1308 spin_unlock(&info->lock); 1308 spin_unlock(&info->lock);
1309 clear_highpage(filepage);
1309 flush_dcache_page(filepage); 1310 flush_dcache_page(filepage);
1310 SetPageUptodate(filepage); 1311 SetPageUptodate(filepage);
1311 } 1312 }