Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5458628pxu; Tue, 22 Dec 2020 18:41:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzEstzNYRRWKCmaYQV8TQsHi7RVZXiIe1NvyVI++G0BQLEUyuzzgBkuh1QvKie4b6hEuJdJ X-Received: by 2002:a17:906:834a:: with SMTP id b10mr22103648ejy.125.1608691297964; Tue, 22 Dec 2020 18:41:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608691297; cv=none; d=google.com; s=arc-20160816; b=mxgI/we9DSM7/BTyRJ+eGuYvNEGaeAi6u+Fe4Lj5tAqtlbebgI70wnzgTQx+xeIXNH 1hKf2UJSeKKn6OEOMl1XssrAazd5KBLFLdiTVW4zHkx7fuucul8tmo/u9l6HE/oKX/62 EbparRdQgofybP7cdlRro9cQYeKzQHeAEUebG79cgW1v2eNmYJRNOkCxuRt8bSF0PV/C Vmw3eXKaKQQmSE+cMS+XZFuwNJqDJCyQjd5ah8WRoO2LsFdNUUcOwDUbWdeJE/4jnxCg UO33hMSHfR68G17WeeCAKoMaNYp73NMv1rsFcEJ36MOIB91pGlXc5sg0nyeUegRpIZNg 5nsA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qlYK1GMjAIxKVdHYEZOUDKLhu2DUFb8Ia37QPY2e/ns=; b=fEk5/cWZMYp/Qyv8DpQGskaKsutAEFwSkE59NhSdXg/N8gtCbi0j9r1xLsCpJTVitM EqKCEqFgA3DpimEa2jKEP7tR+J4f19n11MYUcLWGgMEwnRHe/VDx9NPtkm9EnTji7Jv9 rH6j4qIten136rl8urutJArPr7KegBcWUk47iKOPKIMX76edqoYdg4Jm7vImzW/J+a1Z w1+W2cTsJrG2DWthmkwY+DnxaLvdiJ2TyCoYsqghS8RdxcTIfhNzRnz9XstdPqH6H7O1 pcd7m6n8yKtKwJEnZWCtQEqeK980EgkjWhhDHFyiDUrve6RZR1qwbcxSaHOLYvce2n6o 1Srw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=etV1GHRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g10si10564905ejf.344.2020.12.22.18.41.16; Tue, 22 Dec 2020 18:41:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=etV1GHRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730310AbgLWClL (ORCPT + 99 others); Tue, 22 Dec 2020 21:41:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:52560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728912AbgLWCX2 (ORCPT ); Tue, 22 Dec 2020 21:23:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5E49422AAF; Wed, 23 Dec 2020 02:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690188; bh=MAJyDIDzl0y0Ea6FEt5VUHOzIfZ9GOV1Yrm1iTEG/mE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=etV1GHRk7nmGM/A6yHmSLZUydQXK33Sf0qDEfDHNNE2I/ziTHqWgv/8DZW58M5CJG RhcFwdTtT7M6BMw2wg16li7vIeivRW//qfSognRFhJSjoBF4J7mQfH1UeOsqaQl12i f+53B48KldMlc+zf6oQZaMbUm/sfGMRVj8oq9ENZXaNf+fRuYfyHBteQdz5VL2chnx CY6xwDQhMlGXCUUx6s1KTRM6vIwmzeIz7P77JiKXOSevMp0eUmZL+dMkMLI8dtCh+a LjP++hAu571frMWbgHXW4HKR/A5DGcwx6UEKTCNFb1jFjA9H6W8LjKbK0PZRwW8fDF saunSKBVJ6WFg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Paul E. McKenney" , Sasha Levin , rcu@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 12/66] rcutorture: Prevent hangs for invalid arguments Date: Tue, 22 Dec 2020 21:21:58 -0500 Message-Id: <20201223022253.2793452-12-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" [ Upstream commit 4994684ce10924a0302567c315c91b0a64eeef46 ] If an rcutorture torture-test run is given a bad kvm.sh argument, the test will complain to the console, which is good. What is bad is that from the user's perspective, it will just hang for the time specified by the --duration argument. This commit therefore forces an immediate kernel shutdown if a rcu_torture_init()-time error occurs, thus avoiding the appearance of a hang. It also forces a console splat in this case to clearly indicate the presence of an error. Signed-off-by: Paul E. McKenney Signed-off-by: Sasha Levin --- kernel/rcu/rcutorture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index f0c599bf4058c..0904caa1b7344 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1906,6 +1906,10 @@ rcu_torture_init(void) unwind: torture_init_end(); rcu_torture_cleanup(); + if (shutdown_secs) { + WARN_ON(!IS_MODULE(CONFIG_RCU_TORTURE_TEST)); + kernel_power_off(); + } return firsterr; } -- 2.27.0