Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>2022-05-05 15:41:48 +0300
committerAndrei Vagin <avagin@gmail.com>2022-05-05 22:42:14 +0300
commit0c1f0256ff56e1816fa97f060f5c46bfa7c86a15 (patch)
tree37697f8713ad7d5d56e2566e9349c90dfc697737
parent17a19676cdf803ec985aede9f38b8deaa971ac98 (diff)
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>
-rw-r--r--criu/kerndat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/criu/kerndat.c b/criu/kerndat.c
index 551e18bae..b8b6bc95d 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -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)");