Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 2020 17:23:30 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365593 - head/lib/libc/sys
Message-ID:  <202009101723.08AHNUTY023245@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009101723.08AHNUTY023245>