Skip to content

Commit 0783ac9

Browse files
Hugh Dickinstorvalds
authored andcommitted
mm/shmem: fix build without THP
Some optimizers don't notice that shmem_punch_compound() is always true (PageTransCompound() being false) without CONFIG_TRANSPARENT_HUGEPAGE==y. Use IS_ENABLED to help them to avoid the BUILD_BUG inside HPAGE_PMD_NR. Fixes: 71725ed ("mm: huge tmpfs: try to split_huge_page() when punching hole") Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Tested-by: Randy Dunlap <[email protected]> Acked-by: Randy Dunlap <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 56df70a commit 0783ac9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/shmem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
952952
VM_BUG_ON_PAGE(PageWriteback(page), page);
953953
if (shmem_punch_compound(page, start, end))
954954
truncate_inode_page(mapping, page);
955-
else {
955+
else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
956956
/* Wipe the page and don't get stuck */
957957
clear_highpage(page);
958958
flush_dcache_page(page);

0 commit comments

Comments
 (0)