]> www.infradead.org Git - users/hch/blktests.git/commitdiff
Revert "common/cpuhotplug: allow _offline_cpu() call in sub-shell"
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 27 Jul 2022 01:54:54 +0000 (10:54 +0900)
committerShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Wed, 27 Jul 2022 02:01:08 +0000 (11:01 +0900)
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 <yi.zhang@redhat.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
common/cpuhotplug

index e91c3bca8efb081631623c1cef9b7b0b5ed089b9..7facd0de955e5e08e274d85c344298cbf1808e7e 100644 (file)
@@ -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"
 }