lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220926130341.253039-3-zhaogongyi@huawei.com>
Date:   Mon, 26 Sep 2022 21:03:40 +0800
From:   Zhao Gongyi <zhaogongyi@...wei.com>
To:     <linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linux-mm@...ck.org>, <linux-kselftest@...r.kernel.org>
CC:     <akinobu.mita@...il.com>, <corbet@....net>, <david@...hat.com>,
        <osalvador@...e.de>, <shuah@...nel.org>,
        Zhao Gongyi <zhaogongyi@...wei.com>
Subject: [PATCH -next v3 2/3] selftests/memory-hotplug: Restore memory before exit

Some momory will be left in offline state when calling
offline_memory_expect_fail() failed. Restore it before exit.

Signed-off-by: Zhao Gongyi <zhaogongyi@...wei.com>
---
 .../memory-hotplug/mem-on-off-test.sh         | 22 ++++++++++++++-----
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
index 3edda1f13f7b..6173859d3379 100755
--- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
+++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
@@ -134,6 +134,16 @@ offline_memory_expect_fail()
 	return 0
 }

+online_all_offline_memory()
+{
+	for memory in `hotpluggable_offline_memory`; do
+		online_memory_expect_success $memory || {
+			echo "online memory $memory: unexpected fail"
+			retval=1
+		}
+	done
+}
+
 error=-12
 priority=0
 # Run with default of ratio=2 for Kselftest run
@@ -276,12 +286,7 @@ done
 # Online all hot-pluggable memory
 #
 echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
-for memory in `hotpluggable_offline_memory`; do
-	online_memory_expect_success $memory || {
-		echo "online memory $memory: unexpected fail"
-		retval=1
-	}
-done
+online_all_offline_memory

 #
 # Test memory hot-remove error handling (online => offline)
@@ -299,4 +304,9 @@ done
 echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
 /sbin/modprobe -q -r memory-notifier-error-inject

+#
+# Restore memory before exit
+#
+online_all_offline_memory
+
 exit $retval
--
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ