]> git.baikalelectronics.ru Git - kernel.git/commit
mm/hugetlbfs: fix for_each_hstate() loop in init_hugetlbfs_fs()
authorJan Stancek <jstancek@redhat.com>
Fri, 3 Jan 2020 17:37:18 +0000 (18:37 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Jan 2020 18:39:08 +0000 (10:39 -0800)
commit21a284d4f2a226361539a47bf31de437f92f26af
tree98915c2ae263664ccbf0503d5b65df81cacd10bd
parentcf1e8d09be19f21abe5235ca93e597fcdf0ea3ab
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: 6215c877573b ("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>
fs/hugetlbfs/inode.c