From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 2B6AB1E1DE5 for ; Tue, 9 Jun 2026 13:54:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013299; cv=none; b=d8kvvPhqmTYGWRyx6MVL0sf7MO/slpDSqnC2h4lMp3I4uuIo6FLZ0OoehjsTKTF/ERaEJrylb6e2RAH6C378bg81DuxcI3VkaKtYO6oQirGUPnjzQP4lPwt2qsQHA8/KLwXFQLrvR5gwcILe9xTHfJ6o9QrIqNBitXQW30FOSW0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781013299; c=relaxed/simple; bh=tVMpy/Mu/2+d1suluI4BpgIHnXJRzobbUI6EpCgBbAE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e6JvZmb7EYoU8l009tqLwtc9lI+ssHngb1ltShcWEdyf+ykZs5vLqkBixFLnXoGEjJbVLNaguQKxQBoEhdfooAkfqXXbyjyauDAkGPDfdqiOTW4PwgUrEQR4sdlBWNAiTv4qS0Fu0v1P3cFYrgG9MBeJdQulibFRoKBllgX85sg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qo5Ukypo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qo5Ukypo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D29C11F00898; Tue, 9 Jun 2026 13:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781013298; bh=vEPiUCzSaKihOdGqtVKIJdSb5B4bTJ6xOYlu79mTryA=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Qo5UkypoZQb5XX1xWwstiwuiTXSEe+joOrb2rCho63rjCjh3+sKyeI7RzdQJwk3Lz AEuzUNQsG55dpGthZedGliFNiDK/GeWSMJRKP9OiuO4liyPbzdGo1DfZIcX0sSNq91 zjvu4h0QkbsAzd7aAF6xavNv2B6bthr2vmrG5QVfp7ZWL0hZzDCmNr7Kgh6poZkv8u Eac7WbBsAitvMVtskLnE+TUz/djydShYwnWaAQ+mOkz5bNF+PSWGJv7EqmAon3c6OI AueU+MfqrGA7wcKI1OQ+qfDZxPpc5YFImGAFQvPBkPJ4oi89VqMrQQ24quQZiUzyki TB19ZzLFzZtew== Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfauth.phl.internal (Postfix) with ESMTP id 294AFF40076; Tue, 9 Jun 2026 09:54:57 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Tue, 09 Jun 2026 09:54:57 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFATHqPvSpW4ShhV/VJyMrC73OXAF+aprIHMAT0tANKrziyQVhwFXJ5I7CSaLdqvO H0ou5nOEwne8iM/ju/pcCe+isTkyeGXl4/GlP27opCuaxYIgE91SNOlrTJ4Z3ltcO7L3W5 +AeEUexunST+lrahXkE6GPyZ0WrPvPVV6VgJZ424scSk2B9UTAuuULENfbQLD6+0/C6gmS H/QwRzZQ/Ri/y/Q3D515U2RqoMhdpQFuh9Msalj8+uqxR9/2Zk5BhmufV7bJYwovL+l52N J0qzRThNaO2Klw5IJ27kL5DEZgFJgLexJx+S2AdXVv/8tbuOC3KdEunZfMqJxMBwa78aXF tGnHxqefnyQ8zbrNFODeKoqJrjzU5KmjzEhzFv6Ot0w5JH+OwxTiqAc6qyUSL0wtXEcR5F uk1Wb86MfukLR7KyHSKKp7lhGboNLz+6eGbrTRjWO9+sIUIHrr6NjA/ZtRmf/6iBF6Rv6Y r+J62fAiGvTCcOcAlYqIsPeMck7B3HhNPDYnPJlZw3rtnQo674wvVXrzxNPKrh2ok6AZCh 8Wm5eK7aKXpo5++hftrjcE84Fd7pWr8EOk8AeU925URYyn1gPcItw9SXqTJNJ+AaL95P+5 Kpb+ZZ6GOV0webTQNAYvl3GQwVIIS3Rgvz+XfSaBpehQLCnvv6BKy2wpOdgA X-ME-Proxy: Feedback-ID: i8dbe485b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Jun 2026 09:54:56 -0400 (EDT) Date: Tue, 9 Jun 2026 06:54:55 -0700 From: Boqun Feng To: Waiman Long Cc: Thorsten Blum , Peter Zijlstra , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND] locking/lockdep: Replace snprintf with strscpy in seq_stats Message-ID: References: <20260318001426.2664-3-thorsten.blum@linux.dev> <1a5b1a90-6445-4949-abce-6ec799b959b1@redhat.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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 18, 2026 at 09:44:49AM -0700, Boqun Feng wrote: > On Wed, Mar 18, 2026 at 11:43:49AM -0400, Waiman Long wrote: > > > > On 3/17/26 8:14 PM, Thorsten Blum wrote: > > > Replace snprintf("%s", ...) with the faster and more direct strscpy(). > > > > > > Reviewed-by: Waiman Long > > > Signed-off-by: Thorsten Blum > > > --- > > > kernel/locking/lockdep_proc.c | 5 +++-- > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > diff --git a/kernel/locking/lockdep_proc.c b/kernel/locking/lockdep_proc.c > > > index 1916db9aa46b..e458fa258d05 100644 > > > --- a/kernel/locking/lockdep_proc.c > > > +++ b/kernel/locking/lockdep_proc.c > > > @@ -19,6 +19,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > @@ -488,9 +489,9 @@ static void seq_stats(struct seq_file *m, struct lock_stat_data *data) > > > const char *key_name; > > > key_name = __get_key_name(ckey, str); > > > - snprintf(name, namelen, "%s", key_name); > > > + strscpy(name, key_name, namelen); > > > } else { > > > - snprintf(name, namelen, "%s", cname); > > > + strscpy(name, cname, namelen); > > > } > > > rcu_read_unlock_sched(); > > > > > Acked-by: Waiman Long > > > > Queued, thank you both! > I was trying to merge it for v7.2 but sashiko found it out this: https://sashiko.dev/#/patchset/20260605052331.1628-1-boqun%40kernel.org Thorsten, could you take a look? Regards, Boqun > Regards, > Boqun