import libhugetlbfs-2.21-17.el8

This commit is contained in:
CentOS Sources 2020-06-09 19:43:32 +00:00 committed by Andrew Lukoshko
parent fa274fa7a0
commit c5f6471724
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,52 @@
commit e7b3e6817421763eee37cb35ef8627bdd37a3690
Author: Chunyu Hu <chuhu@redhat.com>
Date: Wed May 6 18:59:43 2020 +0800
Wait child with os.wait()
os.popen() is an async method, it fork() child and exec() in child
with the arg command. If it's slow enough, main process could get
incomplete result.
During our test, we find python3 is faster than python2,after coverting
to python3, 'groupadd' usually doesn't finish when the followed step iter
on groups, we would get '-1' as the groupid and lead to error.
To reproduce it with python3:
/root/rpmbuild/BUILD/libhugetlbfs-2.21/huge_page_setup_helper.py <<EOF
128
hugepages
hugepages root
EOF
...
hugeadm:ERROR: Invalid group specification (-1)
...
Signed-off-by: Chunyu Hu <chuhu@redhat.com>
diff --git a/huge_page_setup_helper.py b/huge_page_setup_helper.py
index a9ba2bf..01fc8dc 100755
--- a/huge_page_setup_helper.py
+++ b/huge_page_setup_helper.py
@@ -169,6 +169,10 @@ else:
os.popen("/usr/sbin/groupadd %s" % userGroupReq)
else:
print("/usr/sbin/groupadd %s" % userGroupReq)
+
+ # wait for the groupadd finish
+ os.wait()
+
groupNames = os.popen("/usr/bin/getent group %s" % userGroupReq).readlines()
for line in groupNames:
curGroupName = line.split(":")[0]
@@ -244,6 +248,9 @@ else:
print("/usr/bin/hugeadm --set-recommended-shmmax")
print()
+# wait for the hugepage setups finish
+os.wait()
+
# figure out what that shmmax value we just set was
hugeadmexplain = os.popen("/usr/bin/hugeadm --explain 2>/dev/null").readlines()
for line in hugeadmexplain:

View File

@ -1,6 +1,6 @@
Name: libhugetlbfs
Version: 2.21
Release: 16%{?dist}
Release: 17%{?dist}
Summary: A library which provides easy access to huge pages of memory
Group: System Environment/Libraries
License: LGPLv2+
@ -38,6 +38,10 @@ Patch7: huge_page_setup_helper-python3-convert.patch
# Fixes for downstream COVSCAN and RPMDiff execshield complaints:
Patch8: tests-fix-covscan-SHELLCHECK_WARNING-complaints.patch
Patch9: tests-include-missing-LDFLAGS-to-make-targets.patch
# Patch10: RHBZ#1832243 "hugeadm: ERROR: Invalid group specification (-1)" fix
# upstream pull request
# https://github.com/libhugetlbfs/libhugetlbfs/pull/48/commits/e7b3e6817421763eee37cb35ef8627bdd37a3690
Patch10: 0001-wait-child-with-os-wait.patch
# Upstream follow-ups for libhugetlbfs-2.21
Patch50: 0001-tests-Add-utility-to-check-for-a-minimum-number-of-o.patch
@ -150,6 +154,7 @@ to verify the libhugetlbfs functionality and validate the library.
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
pathfix.py -i %{__python3} -pn huge_page_setup_helper.py \
tests/run_tests.py
@ -224,6 +229,9 @@ rm -fr $RPM_BUILD_ROOT/%{_sbindir}/
%{_libdir}/libhugetlbfs
%changelog
* Tue May 26 2020 Rafael Aquini <aquini@redhat.com> - 2.21-17
- hugeadm: "ERROR: Invalid group specification" fix (1832243)
* Mon Apr 13 2020 Rafael Aquini <aquini@redhat.com> - 2.21-16
- libhugetlbfs-tests: harden the testcases to satisfy EXECSHIELD RPMDiff checks (1785296)