shmem: fix tmpfs to handle the huge= option properly

shmem_get_unmapped_area() checks SHMEM_SB(sb)->huge incorrectly, which
leads to a reversed effect of "huge=" mount option.

Fix the check in shmem_get_unmapped_area().

Note, the default value of SHMEM_SB(sb)->huge remains as
SHMEM_HUGE_NEVER.  User will need to specify "huge=" option to enable
huge page mappings.

Reported-by: Hillf Danton <>
Signed-off-by: Toshi Kani <>
Acked-by: Kirill A. Shutemov <>
Reviewed-by: Aneesh Kumar K.V <>
Signed-off-by: Hugh Dickins <>
Signed-off-by: Linus Torvalds <>
1 file changed