Message ID | 20210924224332.489iilWzd%akpm@linux-foundation.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [01/16] mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() | expand |
--- a/mm/shmem.c~fix-judgment-error-in-shmem_is_huge +++ a/mm/shmem.c @@ -490,9 +490,9 @@ bool shmem_is_huge(struct vm_area_struct case SHMEM_HUGE_ALWAYS: return true; case SHMEM_HUGE_WITHIN_SIZE: - index = round_up(index, HPAGE_PMD_NR); + index = round_up(index + 1, HPAGE_PMD_NR); i_size = round_up(i_size_read(inode), PAGE_SIZE); - if (i_size >= HPAGE_PMD_SIZE && (i_size >> PAGE_SHIFT) >= index) + if (i_size >> PAGE_SHIFT >= index) return true; fallthrough; case SHMEM_HUGE_ADVISE: