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
This commit is contained in:
Kyle Evans 2020-09-10 17:23:30 +00:00
parent b804b5bca1
commit 944174e7bf

View File

@ -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)