Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1016502rwi; Wed, 19 Oct 2022 05:53:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6TdMbXR8lVYR5a3fXi1pCZ3NjwO99oNRwsDvr80DcHUoN4BnqLZs5M1UwVmARij+nb//lh X-Received: by 2002:a05:6402:164c:b0:459:1e2e:e742 with SMTP id s12-20020a056402164c00b004591e2ee742mr7188795edx.125.1666183989498; Wed, 19 Oct 2022 05:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666183989; cv=none; d=google.com; s=arc-20160816; b=KxWK+Hj+ItIo1+uJiAOwqdZZ0Fs9k0iOJhREhxmRj4s/7uQeXv+A3NcURTZk+n4o3i OBJfzXvOtuEr5/E6xBYZw8qZObjciUQJr8/MgOEA81WpBKmoVClfmQ+6N9qzxk+Y3rRd mBOz0X3/TlLGo246CGfDq6FIouL6araSjn2XGFakbAiSA2DhxvUgNWPp+vvIwc7cyOsR UxWNgFHxvEK4ZPahMeBqu1UVG0xyPvwe0WrNrciPEQq7uDORyzxcr5RWnTvO4kCsoYvv RMxV9cDiDJ+QR2oN4WTnWR4965FBY48Bm3ZB14v7q8aAdqBRlnh+jomJFJ7HP15jEEpg LPtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y70JzDOolKy/GxrA5KTQDDrQE6WV0cW/8gtS4opIXYc=; b=OaGN2OSWPKqxV0RapPTV0Yz+uLPThY0tbg+gzU8wsGQSlAh5yuYZhPdNMnx+v3z+4c 782NsuQFh1b7OOUsnfLngvV55d+kBluPMsIMjcLZAJuHDLwgcq6cwK7Wa+IeTygH3BLu R55Wb0PpPZQL+jP2izeF+B1lC/RMVfqzmPtlvn9cElf1EK1s94cqNSFob82kjzgp9qgw ifiR50GADtB7MK9JEpLYrrwumlI8QT+/xNaKpcrucZ7sz9K/fjSXhjTzSqpZUJRGdBoq 4aVVTRihgggdTCZo/3HT5q0WhcLigg5tDd1B4Csmu4jKpG8q6DlD9NySegVYl9IPmCEN volQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BdJW+BnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp20-20020a170906c15400b0073da0ce043csi15369030ejc.619.2022.10.19.05.52.42; Wed, 19 Oct 2022 05:53:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BdJW+BnB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232399AbiJSL40 (ORCPT + 99 others); Wed, 19 Oct 2022 07:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbiJSLyy (ORCPT ); Wed, 19 Oct 2022 07:54:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E7851B864F; Wed, 19 Oct 2022 04:34:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 906D8B8244F; Wed, 19 Oct 2022 08:59:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07288C433D6; Wed, 19 Oct 2022 08:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169993; bh=coQ3Q/Ae05f07tSDbuwVfPnSEuQZI1GqMFwqyzL101s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BdJW+BnBV/j+1hQVaJcsIwW8zeywOHUTcglyGgWrs7/81ga126WBy+OibzF1E9n83 8vMk+bKCRVZ2PWlgfdv9aIUj8se7AaaX+cBuCq5GuGwcuyc5oef20hiupK96rJxkvt Qy/SY8KDHvVp20UFNLtyabmQxIOWC77SqbyMk0l8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhao Gongyi , Shuah Khan , Sasha Levin Subject: [PATCH 6.0 454/862] selftests/cpu-hotplug: Use return instead of exit Date: Wed, 19 Oct 2022 10:29:01 +0200 Message-Id: <20221019083310.034366440@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhao Gongyi [ Upstream commit 972cf4ce51ef5532d56822af17defb148aac0ccb ] Some cpus will be left in offline state when online function exits in some error conditions. Use return instead of exit to fix it. Signed-off-by: Zhao Gongyi Signed-off-by: Shuah Khan Stable-dep-of: 51d4c851465c ("selftests/cpu-hotplug: Reserve one cpu online at least") Signed-off-by: Sasha Levin --- .../selftests/cpu-hotplug/cpu-on-off-test.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh index 0d26b5e3f966..940b68c940bb 100755 --- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh @@ -4,6 +4,7 @@ SYSFS= # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 +retval=0 prerequisite() { @@ -102,10 +103,10 @@ online_cpu_expect_success() if ! online_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=1 elif ! cpu_is_online $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=1 fi } @@ -128,10 +129,10 @@ offline_cpu_expect_success() if ! offline_cpu $cpu; then echo $FUNCNAME $cpu: unexpected fail >&2 - exit 1 + retval=1 elif ! cpu_is_offline $cpu; then echo $FUNCNAME $cpu: unexpected offline >&2 - exit 1 + retval=1 fi } @@ -201,7 +202,7 @@ if [ $allcpus -eq 0 ]; then offline_cpu_expect_success $present_max online_cpu $present_max fi - exit 0 + exit $retval else echo "Full scope test: all hotplug cpus" echo -e "\t online all offline cpus" @@ -291,3 +292,5 @@ done echo 0 > $NOTIFIER_ERR_INJECT_DIR/actions/CPU_DOWN_PREPARE/error /sbin/modprobe -q -r cpu-notifier-error-inject + +exit $retval -- 2.35.1