From 614fb7de02f72a486c532b2124a4334de3c307e5 Mon Sep 17 00:00:00 2001 From: Bui Quang Minh Date: Tue, 8 Nov 2022 21:10:52 +0700 Subject: kerndat: Mark memfd_create(MFD_HUGETLB) unavailable when ENOSYS is returned Some users on Raspberry Pi report that the kerndat checking for memfd_create(MFD_HUGETLB) support returns ENOSYS even when memfd_create syscall is available. We currently treat this error as unexpected and return error. This commit marks the memfd_create(MFD_HUGETLB) as unavailable when ENOSYS is returned. Signed-off-by: Bui Quang Minh --- criu/kerndat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/kerndat.c b/criu/kerndat.c index a209190ee..5b567e79f 100644 --- a/criu/kerndat.c +++ b/criu/kerndat.c @@ -500,7 +500,7 @@ static bool kerndat_has_memfd_hugetlb(void) if (ret >= 0) { kdat.has_memfd_hugetlb = true; close(ret); - } else if (ret == -1 && (errno == EINVAL || errno == ENOENT)) { + } else if (ret == -1 && (errno == EINVAL || errno == ENOENT || errno == ENOSYS)) { kdat.has_memfd_hugetlb = false; } else { pr_perror("Unexpected error from memfd_create(\"\", MFD_HUGETLB)"); -- cgit v1.2.3