Commit 831ac1f2 authored by Hugh Dickins's avatar Hugh Dickins Committed by Greg Kroah-Hartman

tmpfs: restore missing clear_highpage

patch e84e2e13 in mainline

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: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d57b4ae3
...@@ -1071,7 +1071,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem_inode_info *info, ...@@ -1071,7 +1071,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem_inode_info *info,
pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx); pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx);
pvma.vm_pgoff = idx; pvma.vm_pgoff = idx;
pvma.vm_end = PAGE_SIZE; pvma.vm_end = PAGE_SIZE;
page = alloc_page_vma(gfp | __GFP_ZERO, &pvma, 0); page = alloc_page_vma(gfp, &pvma, 0);
mpol_free(pvma.vm_policy); mpol_free(pvma.vm_policy);
return page; return page;
} }
...@@ -1091,7 +1091,7 @@ shmem_swapin(struct shmem_inode_info *info,swp_entry_t entry,unsigned long idx) ...@@ -1091,7 +1091,7 @@ shmem_swapin(struct shmem_inode_info *info,swp_entry_t entry,unsigned long idx)
static inline struct page * static inline struct page *
shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx) shmem_alloc_page(gfp_t gfp,struct shmem_inode_info *info, unsigned long idx)
{ {
return alloc_page(gfp | __GFP_ZERO); return alloc_page(gfp);
} }
#endif #endif
...@@ -1304,6 +1304,7 @@ repeat: ...@@ -1304,6 +1304,7 @@ repeat:
info->alloced++; info->alloced++;
spin_unlock(&info->lock); spin_unlock(&info->lock);
clear_highpage(filepage);
flush_dcache_page(filepage); flush_dcache_page(filepage);
SetPageUptodate(filepage); SetPageUptodate(filepage);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment