From: Hugh Dickins Date: Wed, 28 Nov 2007 18:55:10 +0000 (+0000) Subject: tmpfs: restore missing clear_highpage X-Git-Tag: v2.6.24-rc4~80 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=e84e2e132c9c66d8498e7710d4ea532d1feaaac5 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 Signed-off-by: Linus Torvalds --- Index: pardus-2.6/mm/shmem.c =================================================================== --- pardus-2.6.orig/mm/shmem.c +++ pardus-2.6/mm/shmem.c @@ -972,7 +972,7 @@ shmem_alloc_page(gfp_t gfp, struct shmem pvma.vm_policy = mpol_shared_policy_lookup(&info->policy, idx); pvma.vm_pgoff = idx; 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); return page; } @@ -992,7 +992,7 @@ shmem_swapin(struct shmem_inode_info *in static inline struct page * 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 @@ -1201,6 +1201,7 @@ repeat: info->alloced++; spin_unlock(&info->lock); + clear_highpage(filepage); flush_dcache_page(filepage); SetPageUptodate(filepage); }