From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0485D23A9B0 for ; Wed, 7 Jan 2026 03:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767754847; cv=none; b=WCblzTmQvuvX/wUmQnuxL/o1c/170+5OVzqqZzl9wKA/yULZ3EVyTlu9OWQYxd99a4dX5ZX83bXPies4WqAe1p8yb9kaedHxKEeC3n1TKoZ2QnVaAj+60Sd4z9/TvsDj3B07g6mMssqz0g0vyyT+TsY+ENXlI+OM0VRlg1rPlP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767754847; c=relaxed/simple; bh=9Q78pXfPxeoJmJurBsfL34+WG3gRooOjCUjtvXi6pDU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZTuYAlaUlys2OIUQ6XABMmn86TAovaut36H1Wdw9Hiz4Tv0ytZTb19dgp/V5l5ssK4exJ40adBnzRXLxS6XUZPhBkiRb2+yfm3uc+mWRLdyMjqkVjz0G9GoFdzyOwTsgiN6T4NSJ5C2SZy0L3RFLD7MLzvVEWZr1rVYfixyKdog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=pwnbHxRm; arc=none smtp.client-ip=115.124.30.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="pwnbHxRm" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1767754842; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; bh=rZeQ+6oa48SlWnTmaOJrgEf9JQHSkjvZmCFeRwQ/WUc=; b=pwnbHxRmnz3Kji99RXqIlOO1B3wPPOr+eElirs8z0P96kShUSVD9EqdAcqIEs8ngHF4jj643McEIqyiOPjVeLk9AQPCABAKNO5qPr0K6wUHhmh4F4sdyk4zlDM+symcMijcLY7AUQERYksk3Vu3PhM2p1cwb9lLOvRjzUEJfuMc= Received: from localhost(mailfrom:feng.tang@linux.alibaba.com fp:SMTPD_---0WwXCUGB_1767754841 cluster:ay36) by smtp.aliyun-inc.com; Wed, 07 Jan 2026 11:00:42 +0800 Date: Wed, 7 Jan 2026 11:00:41 +0800 From: Feng Tang To: Gal Pressman Cc: Andrew Morton , Petr Mladek , linux-kernel@vger.kernel.org, Mark Bloch , Nimrod Oren Subject: Re: [PATCH] panic: only warn about deprecated panic_print on write access Message-ID: References: <20260106163321.83586-1-gal@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260106163321.83586-1-gal@nvidia.com> Hi Gal, Thanks for the fix! On Tue, Jan 06, 2026 at 06:33:21PM +0200, Gal Pressman wrote: > The panic_print_deprecated() warning is being triggered on both read and > write operations to the panic_print parameter. > > This causes spurious warnings when users run 'sysctl -a' to list all > sysctl values, since that command reads /proc/sys/kernel/panic_print and > triggers the deprecation notice. > > Modify the handlers to only emit the deprecation warning when the > parameter is actually being set: > > - sysctl_panic_print_handler(): check 'write' flag before warning. > - panic_print_get(): remove the deprecation call entirely. > > This way, users are only warned when they actively try to use the > deprecated parameter, not when passively querying system state. > > Fixes: ee13240cd78b ("panic: add note that panic_print sysctl interface is deprecated") > Fixes: 2683df6539cb ("panic: add note that 'panic_print' parameter is deprecated") > Cc: Feng Tang > Reviewed-by: Mark Bloch > Reviewed-by: Nimrod Oren > Signed-off-by: Gal Pressman > --- > kernel/panic.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/panic.c b/kernel/panic.c > index 0d52210a9e2b..0c20fcaae98a 100644 > --- a/kernel/panic.c > +++ b/kernel/panic.c > @@ -131,7 +131,8 @@ static int proc_taint(const struct ctl_table *table, int write, > static int sysctl_panic_print_handler(const struct ctl_table *table, int write, > void *buffer, size_t *lenp, loff_t *ppos) > { > - panic_print_deprecated(); > + if (write) > + panic_print_deprecated(); This makes sense to me, as 'sysctl -a' is a very common usage. > return proc_doulongvec_minmax(table, write, buffer, lenp, ppos); > } > > @@ -1014,7 +1015,6 @@ static int panic_print_set(const char *val, const struct kernel_param *kp) > > static int panic_print_get(char *val, const struct kernel_param *kp) > { > - panic_print_deprecated(); Actually this was intentional, in one of the patch version, this panic_print_get() was not there but reusing the param_get_ulong(). It was added later as sometimes developer do want to runtime check the current 'panic_print' setting through /sys/module/kernel/parameters/ interface, and I thought it may be better to give the warning. Thanks, Feng > return param_get_ulong(val, kp); > } > > -- > 2.40.1