From nobody Tue Dec 16 11:49:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C320FC25B6B for ; Thu, 26 Oct 2023 01:27:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232935AbjJZB17 (ORCPT ); Wed, 25 Oct 2023 21:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231288AbjJZB15 (ORCPT ); Wed, 25 Oct 2023 21:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EDCCC for ; Wed, 25 Oct 2023 18:27:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA0E5C433C9; Thu, 26 Oct 2023 01:27:54 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qvpA9-00CqSz-1x; Wed, 25 Oct 2023 21:27:53 -0400 Message-ID: <20231026012753.418244796@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 25 Oct 2023 21:27:35 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Christophe JAILLET , Mukesh ojha Subject: [for-next][PATCH 1/4] tracing/histograms: Simplify last_cmd_set() References: <20231026012734.358814002@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Christophe JAILLET Turn a kzalloc()+strcpy()+strncat() into an equivalent and less verbose kasprintf(). Link: https://lore.kernel.org/linux-trace-kernel/30b6fb04dadc10a03cc1ad08f5= d8a93ef623a167.1697899346.git.christophe.jaillet@wanadoo.fr Cc: Masami Hiramatsu Signed-off-by: Christophe JAILLET Reviewed-by: Mukesh ojha Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events_hist.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_h= ist.c index d06938ae0717..1abc07fba1b9 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -774,23 +774,16 @@ static void last_cmd_set(struct trace_event_file *fil= e, char *str) { const char *system =3D NULL, *name =3D NULL; struct trace_event_call *call; - int len; =20 if (!str) return; =20 - /* sizeof() contains the nul byte */ - len =3D sizeof(HIST_PREFIX) + strlen(str); kfree(last_cmd); - last_cmd =3D kzalloc(len, GFP_KERNEL); + + last_cmd =3D kasprintf(GFP_KERNEL, HIST_PREFIX "%s", str); if (!last_cmd) return; =20 - strcpy(last_cmd, HIST_PREFIX); - /* Again, sizeof() contains the nul byte */ - len -=3D sizeof(HIST_PREFIX); - strncat(last_cmd, str, len); - if (file) { call =3D file->event_call; system =3D call->class->system; --=20 2.42.0 From nobody Tue Dec 16 11:49:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6171DC0032E for ; Thu, 26 Oct 2023 01:28:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232788AbjJZB2G (ORCPT ); Wed, 25 Oct 2023 21:28:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232626AbjJZB15 (ORCPT ); Wed, 25 Oct 2023 21:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250F8136 for ; Wed, 25 Oct 2023 18:27:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C170FC433CC; Thu, 26 Oct 2023 01:27:54 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qvpA9-00CqTX-2c; Wed, 25 Oct 2023 21:27:53 -0400 Message-ID: <20231026012753.628263428@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 25 Oct 2023 21:27:36 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Christoph Hellwig , Justin Stitt , Kent Overstreet , Petr Mladek , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , Michael Ellerman , Kees Cook , "Matthew Wilcox (Oracle)" Subject: [for-next][PATCH 2/4] powerpc: Remove initialisation of readpos References: <20231026012734.358814002@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Matthew Wilcox (Oracle)" While powerpc doesn't use the seq_buf readpos, it did explicitly initialise it for no good reason. Link: https://lore.kernel.org/linux-trace-kernel/20231024145600.739451-1-wi= lly@infradead.org Cc: Christoph Hellwig Cc: Justin Stitt Cc: Kent Overstreet Cc: Petr Mladek Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Cc: Michael Ellerman Reviewed-by: Kees Cook Fixes: d0ed46b60396 ("tracing: Move readpos from seq_buf to trace_seq") Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Steven Rostedt (Google) --- arch/powerpc/kernel/setup-common.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup= -common.c index 2f1026fba00d..34975532e44c 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -601,7 +601,6 @@ struct seq_buf ppc_hw_desc __initdata =3D { .buffer =3D ppc_hw_desc_buf, .size =3D sizeof(ppc_hw_desc_buf), .len =3D 0, - .readpos =3D 0, }; =20 static __init void probe_machine(void) --=20 2.42.0 From nobody Tue Dec 16 11:49:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51F3CC25B47 for ; Thu, 26 Oct 2023 01:28:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230086AbjJZB2C (ORCPT ); Wed, 25 Oct 2023 21:28:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbjJZB15 (ORCPT ); Wed, 25 Oct 2023 21:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FF71185 for ; Wed, 25 Oct 2023 18:27:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C47AC43395; Thu, 26 Oct 2023 01:27:55 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qvpAA-00CqU5-05; Wed, 25 Oct 2023 21:27:54 -0400 Message-ID: <20231026012753.831438923@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 25 Oct 2023 21:27:37 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton Subject: [for-next][PATCH 3/4] eventfs: Fix WARN_ON() in create_file_dentry() References: <20231026012734.358814002@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" As the comment right above a WARN_ON() in create_file_dentry() states: * Note, with the mutex held, the e_dentry cannot have content * and the ei->is_freed be true at the same time. But the WARN_ON() only has: WARN_ON_ONCE(ei->is_free); Where to match the comment (and what it should actually do) is: dentry =3D *e_dentry; WARN_ON_ONCE(dentry && ei->is_free) Also in that case, set dentry to NULL (although it should never happen). Link: https://lore.kernel.org/linux-trace-kernel/20231024123628.62b88755@ga= ndalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_in= ode") Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 09ab93357957..4d2da7480e5f 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -264,8 +264,9 @@ create_file_dentry(struct eventfs_inode *ei, struct den= try **e_dentry, * Note, with the mutex held, the e_dentry cannot have content * and the ei->is_freed be true at the same time. */ - WARN_ON_ONCE(ei->is_freed); dentry =3D *e_dentry; + if (WARN_ON_ONCE(dentry && ei->is_freed)) + dentry =3D NULL; /* The lookup does not need to up the dentry refcount */ if (dentry && !lookup) dget(dentry); --=20 2.42.0 From nobody Tue Dec 16 11:49:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C91C25B47 for ; Thu, 26 Oct 2023 01:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233192AbjJZB2I (ORCPT ); Wed, 25 Oct 2023 21:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbjJZB15 (ORCPT ); Wed, 25 Oct 2023 21:27:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A8F7186 for ; Wed, 25 Oct 2023 18:27:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37908C4339A; Thu, 26 Oct 2023 01:27:55 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qvpAA-00CqUd-0k; Wed, 25 Oct 2023 21:27:54 -0400 Message-ID: <20231026012754.043877861@goodmis.org> User-Agent: quilt/0.66 Date: Wed, 25 Oct 2023 21:27:38 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton Subject: [for-next][PATCH 4/4] eventfs: Fix typo in eventfs_inode union comment References: <20231026012734.358814002@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" It's eventfs_inode not eventfs_indoe. There's no deer involved! Link: https://lore.kernel.org/linux-trace-kernel/20231024131024.5634c743@ga= ndalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d672 ("eventfs: Remove eventfs_file and just use eventfs_in= ode") Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index 298d3ecaf621..64fde9490f52 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -37,7 +37,7 @@ struct eventfs_inode { /* * Union - used for deletion * @del_list: list of eventfs_inode to delete - * @rcu: eventfs_indoe to delete in RCU + * @rcu: eventfs_inode to delete in RCU * @is_freed: node is freed if one of the above is set */ union { --=20 2.42.0