* [PATCH 1/2] selftests/memfd: Actually make the test executable.
@ 2017-09-07 18:36 Thomas Meyer
2017-09-07 18:36 ` [PATCH 2/2] selftests/memfd: Add null check for freepgs Thomas Meyer
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2017-09-07 18:36 UTC (permalink / raw)
To: shuah, linux-kernel; +Cc: Thomas Meyer
The current shell script misses the execute flag.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
tools/testing/selftests/memfd/run_tests.sh | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tools/testing/selftests/memfd/run_tests.sh
diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_tests.sh
old mode 100644
new mode 100755
--
2.11.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] selftests/memfd: Add null check for freepgs.
2017-09-07 18:36 [PATCH 1/2] selftests/memfd: Actually make the test executable Thomas Meyer
@ 2017-09-07 18:36 ` Thomas Meyer
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Meyer @ 2017-09-07 18:36 UTC (permalink / raw)
To: shuah, linux-kernel; +Cc: Thomas Meyer
User mode linux kernel has no huge pages. So this variable will be null.
Guard all tests in the shell script with a null check.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
tools/testing/selftests/memfd/run_tests.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/memfd/run_tests.sh b/tools/testing/selftests/memfd/run_tests.sh
index daabb350697c..0b65bacf8694 100755
--- a/tools/testing/selftests/memfd/run_tests.sh
+++ b/tools/testing/selftests/memfd/run_tests.sh
@@ -46,7 +46,7 @@ fi
# If still not enough huge pages available, exit. But, give back any huge
# pages potentially allocated above.
#
-if [ $freepgs -lt $hpages_test ]; then
+if [ -n "$freepgs" ] && [ $freepgs -lt $hpages_test ]; then
# nr_hugepgs non-zero only if we attempted to increase
if [ -n "$nr_hugepgs" ]; then
echo $nr_hugepgs > /proc/sys/vm/nr_hugepages
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-07 18:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-07 18:36 [PATCH 1/2] selftests/memfd: Actually make the test executable Thomas Meyer
2017-09-07 18:36 ` [PATCH 2/2] selftests/memfd: Add null check for freepgs Thomas Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).