mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
kerndat: handle the case when hugetlb isn't supported
Currently we check memfd_hugetlb by doing memfd_create("", MFD_HUGETLB). If we see EINVAL we report that it's not supported, but we can also get ENOENT error in such case in hugetlb_file_setup() while trying to find proper hugetlbfs mount. Reference: https://github.com/torvalds/linux/blob/06fb4ecfeac/fs/hugetlbfs/inode.c#L1465 Fixes: 4245e6b02fa ("check: Add a check for using memfd with hugetlb") Reported-by: Mr. Jenkins (ppc64le) Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
This commit is contained in:
parent
17a19676cd
commit
0c1f0256ff
@ -502,7 +502,7 @@ static bool kerndat_has_memfd_hugetlb(void)
|
||||
if (ret >= 0) {
|
||||
kdat.has_memfd_hugetlb = true;
|
||||
close(ret);
|
||||
} else if (ret == -1 && errno == EINVAL) {
|
||||
} else if (ret == -1 && (errno == EINVAL || errno == ENOENT)) {
|
||||
kdat.has_memfd_hugetlb = false;
|
||||
} else {
|
||||
pr_perror("Unexpected error from memfd_create(\"\", MFD_HUGETLB)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user