Message ID | 20240226170011.22798-2-d.dulov@aladdin.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2214709dyb; Mon, 26 Feb 2024 09:13:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVm5sPnUtfwGBE36jtB8WFqhVG9Isp3hF99WW9T0dRu/k8faekkmpEwHl0HooL7M0eFRRdUNSBw0aitu6qI+wOABfyE9Q== X-Google-Smtp-Source: AGHT+IGW+4Ztk4wons2EBvaRfheM6NwlECm1ca1siG5WeF+KUArdf8RbyKPCq7YwHauvxmIqKHKt X-Received: by 2002:a17:906:c357:b0:a43:8330:6919 with SMTP id ci23-20020a170906c35700b00a4383306919mr1054135ejb.15.1708967629821; Mon, 26 Feb 2024 09:13:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708967629; cv=pass; d=google.com; s=arc-20160816; b=ddanuMnpOWDf8LwFoEPymPYnE4XaWmB7o83hZiFbebTC8UEzdLjKbYNhcxVNxoq51D 3pncNgY5jRgmPoyG77+BPyAwd3eRABtuA7vBWxWKUl20biK+YHr98GQjaDLwEYe9Cud8 +f+0L6JfeWWADPds5oPN9TqKdZehlMlAFWpWQ54kY2YZvmkHfnNwdW4isAKF2c4TX7cd S5UvE0kf9OHAXuOVTDWNctjMVwWLjxSDyEJJCg9zYSscHDsiRZQKcsBXCLQri2tO3y5g d1ZkmYoNbXTnZ7dKqvzfOUXBS9FyjatO0CxTK+2TJkLVghq32ufC/HfZlFxdfRpcXTR3 64aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=HaB+IL9Gz6By3S05dxLI0jxHbLCwBmIwo++0N24GrNU=; fh=9C2Yya9gmg/NP4SjFJ4yN8nHfFLYOaIarW/WPY7hQ44=; b=AQFihMl4mOxnf3nE1e3pzzWo5LnF4sMipn6fCcMX1dZAhNP+R3omQQc3fG0jIAOhnb CQ9ixUoDMDFYK83YO3VKEEJhQGSz6W9hYQfcUDi/9ojr/Xroydm4iTUBZUidNV+r50gk /WTfbayn/uV/7SZ0Rro9TVMw5d+LudGQ+BTPZIQslAo9FTkYIO8SEXCkA7DMPe1DJzKi vYwOVqRjFqvLCreOtRthh3YBk2L2mulMVP/OP8XRa5sDtISfBmJi/vSf/2r1RwiWku/X Gw9169e4SsImTQljmSjWIEh91uhICMT5Ke04C3onp9Onv8ZAUZEh5EjOm/ABrSgWwZAy E3Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g16-20020a170906395000b00a3e58786ab0si2178289eje.495.2024.02.26.09.13.49 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 09:13:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82013-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 666DF1F27135 for <ouuuleilei@gmail.com>; Mon, 26 Feb 2024 17:13:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 126C812CD8E; Mon, 26 Feb 2024 17:00:38 +0000 (UTC) Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 868ED133429; Mon, 26 Feb 2024 17:00:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966836; cv=none; b=hhlQRbgi9vqcTBihtF1YMM32PXXFQTv7FzAFQNHB98eJdPzTwXHzy8yq5diuU/lsHQ33WhtXKLhZq3iOH9UJI+oCzHUdLo66KLALvh7snEQevxFjjjLxnpcGkU4yFJvVNvi9GoTVRaSM812eIvb5zTwBcSM0Gf+McnJz0XZEjqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708966836; c=relaxed/simple; bh=TJQajcvykBMBxUEeqy/MVrgfkPcyDTbvbZrHw1dY2c0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=DAuNCR0gcAoHJ6QZnlAKHYlayDYYHesBlPlImpGgyQa7xYyqcHM3xWgbxYNRXwHhmL/SfN/GEI90IwgwUmt0KiG8lmfFMo5CrPEJpW3E1ACAP0bg1uCbFYdszuDr9iVkhitaUiApol8w3Vhp5eFdRjpJW5npu8rFYKyBM0+VrnU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov <d.dulov@aladdin.ru> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, <stable@vger.kernel.org> CC: Daniil Dulov <d.dulov@aladdin.ru>, Davidlohr Bueso <dave@stgolabs.net>, "Paul E. McKenney" <paulmck@kernel.org>, Josh Triplett <josh@joshtriplett.org>, Steven Rostedt <rostedt@goodmis.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Lai Jiangshan <jiangshanlai@gmail.com>, Joel Fernandes <joel@joelfernandes.org>, <linux-kernel@vger.kernel.org>, <rcu@vger.kernel.org>, <lvc-project@linuxtesting.org>, David Vernet <void@manifault.com> Subject: [PATCH 5.10 1/1] rcutorture: Add missing return and use __func__ in warning Date: Mon, 26 Feb 2024 20:00:11 +0300 Message-ID: <20240226170011.22798-2-d.dulov@aladdin.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240226170011.22798-1-d.dulov@aladdin.ru> References: <20240226170011.22798-1-d.dulov@aladdin.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EXCH-2016-01.aladdin.ru (192.168.1.101) To EXCH-2016-01.aladdin.ru (192.168.1.101) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791982404508292213 X-GMAIL-MSGID: 1791982441042864916 |
Series |
rcutorture: Add missing return and use __func__ in warning
|
|
Commit Message
Daniil Dulov
Feb. 26, 2024, 5 p.m. UTC
From: David Vernet <void@manifault.com> commit 80dcee695143255261f30c7cc2a041ba413717a4 upstream. The rcutorture module has an rcu_torture_writer task that repeatedly performs writes, synchronizations, and deletes. There is a corner-case check in rcu_torture_writer() wherein if nsynctypes is 0, a warning is issued and the task waits to be stopped via a call to torture_kthread_stopping() rather than performing any work. There should be a return statement following this call to torture_kthread_stopping(), as the intention with issuing the call to torture_kthread_stopping() in the first place is to avoid the rcu_torture_writer task from performing any work. Some of the work may even be dangerous to perform, such as potentially causing a #DE due to nsynctypes being used in a modulo operator when querying for sync updates to issue. This patch adds the missing return call. As a bonus, it also fixes a checkpatch warning that was emitted due to the WARN_ONCE() call using the name of the function rather than __func__. Signed-off-by: David Vernet <void@manifault.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> --- kernel/rcu/rcutorture.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 6c1aea48a79a..69856904838c 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -1063,7 +1063,7 @@ rcu_torture_writer(void *arg) pr_alert("%s: gp_sync without primitives.\n", __func__); } if (WARN_ONCE(nsynctypes == 0, - "rcu_torture_writer: No update-side primitives.\n")) { + "%s: No update-side primitives.\n", __func__)) { /* * No updates primitives, so don't try updating. * The resulting test won't be testing much, hence the @@ -1071,6 +1071,7 @@ rcu_torture_writer(void *arg) */ rcu_torture_writer_state = RTWS_STOPPING; torture_kthread_stopping("rcu_torture_writer"); + return 0; } do {