Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/hugetlbfs: fix for_each_hstate() loop in init_hugetlbfs_fs()

LTP memfd_create04 started failing for some huge page sizes
after v5.4-10135-gc3bfc5dd73c6.

The problem is the check introduced to for_each_hstate() loop that
should skip default_hstate_idx. Since it doesn't update 'i' counter,
all subsequent huge page sizes are skipped as well.

Fixes: 8fc312b32b25 ("mm/hugetlbfs: fix error handling when setting up mounts")
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jan Stancek and committed by
Linus Torvalds
15f0ec94 7ca4ad5b

+3 -1
+3 -1
fs/hugetlbfs/inode.c
··· 1498 1498 /* other hstates are optional */ 1499 1499 i = 0; 1500 1500 for_each_hstate(h) { 1501 - if (i == default_hstate_idx) 1501 + if (i == default_hstate_idx) { 1502 + i++; 1502 1503 continue; 1504 + } 1503 1505 1504 1506 mnt = mount_one_hugetlbfs(h); 1505 1507 if (IS_ERR(mnt))