From de5d03f22509d83103b8c191fb43ddddbdad3c95 Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Wed, 27 Jul 2022 10:54:54 +0900 Subject: [PATCH] Revert "common/cpuhotplug: allow _offline_cpu() call in sub-shell" This reverts commit 107256dc53d55f558e349e463a5a99c3bb6b4189. The commit makes block/008 fail when multiple devices are set as TEST_DEVS. Link: https://lore.kernel.org/linux-block/CAHj4cs_XGXhHZsipb-BA2O_acaeBjDXa-CDfY771=a_GfEaU6w@mail.gmail.com/ Reported-by: Yi Zhang Signed-off-by: Shin'ichiro Kawasaki --- common/cpuhotplug | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/common/cpuhotplug b/common/cpuhotplug index e91c3bc..7facd0d 100644 --- a/common/cpuhotplug +++ b/common/cpuhotplug @@ -27,20 +27,17 @@ _have_cpu_hotplug() { SKIP_REASONS+=("CPU hotplugging is not supported") return 1 fi - - RESTORE_CPUS_ONLINE=1 return 0 } _online_cpu() { + # shellcheck disable=SC2034 + RESTORE_CPUS_ONLINE=1 echo 1 > "/sys/devices/system/cpu/cpu$1/online" } _offline_cpu() { - if [[ -z ${RESTORE_CPUS_ONLINE} ]]; then - echo "offlining cpu but RESTORE_CPUS_ONLINE is not set" - return 1 - fi - + # shellcheck disable=SC2034 + RESTORE_CPUS_ONLINE=1 echo 0 > "/sys/devices/system/cpu/cpu$1/online" } -- 2.49.0