svn commit: r365593 - head/lib/libc/sys

Kyle Evans kevans at FreeBSD.org
Thu Sep 10 17:23:30 UTC 2020


Author: kevans
Date: Thu Sep 10 17:23:30 2020
New Revision: 365593
URL: https://svnweb.freebsd.org/changeset/base/365593

Log:
  Fix memfd_create tests after r365524
  
  r365524 did accidentally invert this check that sets SHM_LARGEPAGE, leading
  non-hugetlb memfd as unconfigured largepage shm and thus test failures when
  we try to ftruncate or write to them.
  
  PR:		249236
  Discussed with:	kib

Modified:
  head/lib/libc/sys/shm_open.c

Modified: head/lib/libc/sys/shm_open.c
==============================================================================
--- head/lib/libc/sys/shm_open.c	Thu Sep 10 17:15:44 2020	(r365592)
+++ head/lib/libc/sys/shm_open.c	Thu Sep 10 17:23:30 2020	(r365593)
@@ -136,7 +136,7 @@ memfd_create(const char *name, unsigned int flags)
 		oflags |= O_CLOEXEC;
 	if ((flags & MFD_ALLOW_SEALING) != 0)
 		shmflags |= SHM_ALLOW_SEALING;
-	if ((flags & MFD_HUGETLB) == 0)
+	if ((flags & MFD_HUGETLB) != 0)
 		shmflags |= SHM_LARGEPAGE;
 	fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name);
 	if (fd == -1 || (flags & MFD_HUGETLB) == 0)


More information about the svn-src-head mailing list