From nobody Tue Dec 16 23:43:07 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 A7F9FC001DF for ; Fri, 20 Oct 2023 22:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230211AbjJTW1r (ORCPT ); Fri, 20 Oct 2023 18:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbjJTW1n (ORCPT ); Fri, 20 Oct 2023 18:27:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 997021A3 for ; Fri, 20 Oct 2023 15:27:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 400ABC433C9; Fri, 20 Oct 2023 22:27:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxxz-00AQYF-2w; Fri, 20 Oct 2023 18:27:39 -0400 Message-ID: <20231020222739.722516559@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:14 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Kees Cook , Nathan Chancellor Subject: [for-next][PATCH 1/6] eventfs: Use ERR_CAST() in eventfs_create_events_dir() References: <20231020222713.074741220@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: Nathan Chancellor When building with clang and CONFIG_RANDSTRUCT_FULL=3Dy, there is an error due to a cast in eventfs_create_events_dir(): fs/tracefs/event_inode.c:734:10: error: casting from randomized structure= pointer type 'struct dentry *' to 'struct eventfs_inode *' 734 | return (struct eventfs_inode *)dentry; | ^ 1 error generated. Use the ERR_CAST() function to resolve the error, as it was designed for this exact situation (casting an error pointer to another type). Link: https://lore.kernel.org/linux-trace-kernel/20231018-ftrace-fix-clang-= randstruct-v1-1-338cb214abfb@kernel.org Closes: https://github.com/ClangBuiltLinux/linux/issues/1947 Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_ino= de") Reviewed-by: Kees Cook Signed-off-by: Nathan Chancellor Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 1ccd100bc565..9f19b6608954 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -731,7 +731,7 @@ struct eventfs_inode *eventfs_create_events_dir(const c= har *name, struct dentry return NULL; =20 if (IS_ERR(dentry)) - return (struct eventfs_inode *)dentry; + return ERR_CAST(dentry); =20 ei =3D kzalloc(sizeof(*ei), GFP_KERNEL); if (!ei) --=20 2.42.0 From nobody Tue Dec 16 23:43:07 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 DE6EFC004C0 for ; Fri, 20 Oct 2023 22:27:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230297AbjJTW1u (ORCPT ); Fri, 20 Oct 2023 18:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjJTW1n (ORCPT ); Fri, 20 Oct 2023 18:27:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D5DD5A for ; Fri, 20 Oct 2023 15:27:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E5E9C433CA; Fri, 20 Oct 2023 22:27:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxy0-00AQYo-0V; Fri, 20 Oct 2023 18:27:40 -0400 Message-ID: <20231020222739.960696059@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:15 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Julia Lawall Subject: [for-next][PATCH 2/6] eventfs: Fix failure path in eventfs_create_events_dir() References: <20231020222713.074741220@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)" The failure path of allocating ei goes to a path that dereferences ei. Add another label that skips over the ei dereferences to do the rest of the clean up. Link: https://lore.kernel.org/all/70e7bace-561c-95f-1117-706c2c220bc@inria.= fr/ Link: https://lore.kernel.org/linux-trace-kernel/20231019204132.6662fef0@ga= ndalf.local.home Cc: Masami Hiramatsu Cc: Mark Rutland Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_ino= de") Reported-by: Julia Lawall 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 9f19b6608954..1885f1f1f339 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -735,7 +735,7 @@ struct eventfs_inode *eventfs_create_events_dir(const c= har *name, struct dentry =20 ei =3D kzalloc(sizeof(*ei), GFP_KERNEL); if (!ei) - goto fail; + goto fail_ei; =20 inode =3D tracefs_get_inode(dentry->d_sb); if (unlikely(!inode)) @@ -781,6 +781,7 @@ struct eventfs_inode *eventfs_create_events_dir(const c= har *name, struct dentry fail: kfree(ei->d_children); kfree(ei); + fail_ei: tracefs_failed_creating(dentry); return ERR_PTR(-ENOMEM); } --=20 2.42.0 From nobody Tue Dec 16 23:43:07 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 6050BC0032E for ; Fri, 20 Oct 2023 22:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbjJTW1y (ORCPT ); Fri, 20 Oct 2023 18:27:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjJTW1o (ORCPT ); Fri, 20 Oct 2023 18:27:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A6FD5B for ; Fri, 20 Oct 2023 15:27:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64385C433CC; Fri, 20 Oct 2023 22:27:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxy0-00AQZM-1C; Fri, 20 Oct 2023 18:27:40 -0400 Message-ID: <20231020222740.185464260@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:16 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Dan Carpenter Subject: [for-next][PATCH 3/6] tracing: Fix a NULL vs IS_ERR() bug in event_subsystem_dir() References: <20231020222713.074741220@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: Dan Carpenter The eventfs_create_dir() function returns error pointers, it never returns NULL. Update the check to reflect that. Link: https://lore.kernel.org/linux-trace-kernel/ff641474-84e2-46a7-9d7a-62= b251a1050c@moroto.mountain Cc: Masami Hiramatsu Fixes: 5790b1fb3d67 ("eventfs: Remove eventfs_file and just use eventfs_ino= de") Signed-off-by: Dan Carpenter Signed-off-by: Steven Rostedt (Google) --- kernel/trace/trace_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index db46d2116500..f9e3e24d8796 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c @@ -2354,7 +2354,7 @@ event_subsystem_dir(struct trace_array *tr, const cha= r *name, nr_entries =3D ARRAY_SIZE(system_entries); =20 ei =3D eventfs_create_dir(name, parent, system_entries, nr_entries, dir); - if (!ei) { + if (IS_ERR(ei)) { pr_warn("Failed to create system directory %s\n", name); __put_system(system); goto out_free; --=20 2.42.0 From nobody Tue Dec 16 23:43:07 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 B91AFC0032E for ; Fri, 20 Oct 2023 22:28:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229723AbjJTW2D (ORCPT ); Fri, 20 Oct 2023 18:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230227AbjJTW1r (ORCPT ); Fri, 20 Oct 2023 18:27:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A4E9D65 for ; Fri, 20 Oct 2023 15:27:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5231C43397; Fri, 20 Oct 2023 22:27:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxy0-00AQZu-1v; Fri, 20 Oct 2023 18:27:40 -0400 Message-ID: <20231020222740.410840872@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:17 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Abaci Robot , Jiapeng Chong Subject: [for-next][PATCH 4/6] tracefs/eventfs: Modify mismatched function name References: <20231020222713.074741220@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: Jiapeng Chong No functional modification involved. fs/tracefs/event_inode.c:864: warning: expecting prototype for eventfs_remo= ve(). Prototype was for eventfs_remove_dir() instead. Link: https://lore.kernel.org/linux-trace-kernel/20231019031353.73846-1-jia= peng.chong@linux.alibaba.com Reported-by: Abaci Robot Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=3D6939 Signed-off-by: Jiapeng Chong Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/event_inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index 1885f1f1f339..09ab93357957 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -856,7 +856,7 @@ static void unhook_dentry(struct dentry **dentry, struc= t dentry **list) } } /** - * eventfs_remove - remove eventfs dir or file from list + * eventfs_remove_dir - remove eventfs dir or file from list * @ei: eventfs_inode to be removed. * * This function acquire the eventfs_mutex lock and call eventfs_remove_re= c() --=20 2.42.0 From nobody Tue Dec 16 23:43:07 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 0463FC004C0 for ; Fri, 20 Oct 2023 22:28:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231792AbjJTW2A (ORCPT ); Fri, 20 Oct 2023 18:28:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjJTW1p (ORCPT ); Fri, 20 Oct 2023 18:27:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3CEDD67 for ; Fri, 20 Oct 2023 15:27:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C610EC433C8; Fri, 20 Oct 2023 22:27:41 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxy0-00AQaS-2e; Fri, 20 Oct 2023 18:27:40 -0400 Message-ID: <20231020222740.632819967@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:18 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Kees Cook , Justin Stitt , Kent Overstreet , Petr Mladek , Andy Shevchenko , Rasmus Villemoes , Sergey Senozhatsky , "Matthew Wilcox (Oracle)" , Christoph Hellwig , Greg Kroah-Hartman Subject: [for-next][PATCH 5/6] tracing: Move readpos from seq_buf to trace_seq References: <20231020222713.074741220@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)" To make seq_buf more lightweight as a string buf, move the readpos member from seq_buf to its container, trace_seq. That puts the responsibility of maintaining the readpos entirely in the tracing code. If some future users want to package up the readpos with a seq_buf, we can define a new struct then. Link: https://lore.kernel.org/linux-trace-kernel/20231020033545.2587554-2-w= illy@infradead.org Cc: Kees Cook Cc: Justin Stitt Cc: Kent Overstreet Cc: Petr Mladek Cc: Andy Shevchenko Cc: Rasmus Villemoes Cc: Sergey Senozhatsky Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Acked-by: Greg Kroah-Hartman Signed-off-by: Steven Rostedt (Google) --- include/linux/seq_buf.h | 5 +---- include/linux/trace_seq.h | 2 ++ kernel/trace/trace.c | 10 +++++----- kernel/trace/trace_seq.c | 6 +++++- lib/seq_buf.c | 22 ++++++++++------------ 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h index 515d7fcb9634..a0fb013cebdf 100644 --- a/include/linux/seq_buf.h +++ b/include/linux/seq_buf.h @@ -14,19 +14,16 @@ * @buffer: pointer to the buffer * @size: size of the buffer * @len: the amount of data inside the buffer - * @readpos: The next position to read in the buffer. */ struct seq_buf { char *buffer; size_t size; size_t len; - loff_t readpos; }; =20 static inline void seq_buf_clear(struct seq_buf *s) { s->len =3D 0; - s->readpos =3D 0; } =20 static inline void @@ -143,7 +140,7 @@ extern __printf(2, 0) int seq_buf_vprintf(struct seq_buf *s, const char *fmt, va_list args); extern int seq_buf_print_seq(struct seq_file *m, struct seq_buf *s); extern int seq_buf_to_user(struct seq_buf *s, char __user *ubuf, - int cnt); + size_t start, int cnt); extern int seq_buf_puts(struct seq_buf *s, const char *str); extern int seq_buf_putc(struct seq_buf *s, unsigned char c); extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int= len); diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index 6be92bf559fe..3691e0e76a1a 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h @@ -14,6 +14,7 @@ struct trace_seq { char buffer[PAGE_SIZE]; struct seq_buf seq; + size_t readpos; int full; }; =20 @@ -22,6 +23,7 @@ trace_seq_init(struct trace_seq *s) { seq_buf_init(&s->seq, s->buffer, PAGE_SIZE); s->full =3D 0; + s->readpos =3D 0; } =20 /** diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 4383be8fa1b0..d629065c2383 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1731,15 +1731,15 @@ static ssize_t trace_seq_to_buffer(struct trace_seq= *s, void *buf, size_t cnt) { int len; =20 - if (trace_seq_used(s) <=3D s->seq.readpos) + if (trace_seq_used(s) <=3D s->readpos) return -EBUSY; =20 - len =3D trace_seq_used(s) - s->seq.readpos; + len =3D trace_seq_used(s) - s->readpos; if (cnt > len) cnt =3D len; - memcpy(buf, s->buffer + s->seq.readpos, cnt); + memcpy(buf, s->buffer + s->readpos, cnt); =20 - s->seq.readpos +=3D cnt; + s->readpos +=3D cnt; return cnt; } =20 @@ -7008,7 +7008,7 @@ tracing_read_pipe(struct file *filp, char __user *ubu= f, =20 /* Now copy what we have to the user */ sret =3D trace_seq_to_user(&iter->seq, ubuf, cnt); - if (iter->seq.seq.readpos >=3D trace_seq_used(&iter->seq)) + if (iter->seq.readpos >=3D trace_seq_used(&iter->seq)) trace_seq_init(&iter->seq); =20 /* diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c index bac06ee3b98b..7be97229ddf8 100644 --- a/kernel/trace/trace_seq.c +++ b/kernel/trace/trace_seq.c @@ -370,8 +370,12 @@ EXPORT_SYMBOL_GPL(trace_seq_path); */ int trace_seq_to_user(struct trace_seq *s, char __user *ubuf, int cnt) { + int ret; __trace_seq_init(s); - return seq_buf_to_user(&s->seq, ubuf, cnt); + ret =3D seq_buf_to_user(&s->seq, ubuf, s->readpos, cnt); + if (ret > 0) + s->readpos +=3D ret; + return ret; } EXPORT_SYMBOL_GPL(trace_seq_to_user); =20 diff --git a/lib/seq_buf.c b/lib/seq_buf.c index 45c450f423fa..b7477aefff53 100644 --- a/lib/seq_buf.c +++ b/lib/seq_buf.c @@ -324,23 +324,24 @@ int seq_buf_path(struct seq_buf *s, const struct path= *path, const char *esc) * seq_buf_to_user - copy the sequence buffer to user space * @s: seq_buf descriptor * @ubuf: The userspace memory location to copy to + * @start: The first byte in the buffer to copy * @cnt: The amount to copy * * Copies the sequence buffer into the userspace memory pointed to - * by @ubuf. It starts from the last read position (@s->readpos) - * and writes up to @cnt characters or till it reaches the end of - * the content in the buffer (@s->len), which ever comes first. + * by @ubuf. It starts from @start and writes up to @cnt characters + * or until it reaches the end of the content in the buffer (@s->len), + * whichever comes first. * * On success, it returns a positive number of the number of bytes * it copied. * * On failure it returns -EBUSY if all of the content in the * sequence has been already read, which includes nothing in the - * sequence (@s->len =3D=3D @s->readpos). + * sequence (@s->len =3D=3D @start). * * Returns -EFAULT if the copy to userspace fails. */ -int seq_buf_to_user(struct seq_buf *s, char __user *ubuf, int cnt) +int seq_buf_to_user(struct seq_buf *s, char __user *ubuf, size_t start, in= t cnt) { int len; int ret; @@ -350,20 +351,17 @@ int seq_buf_to_user(struct seq_buf *s, char __user *u= buf, int cnt) =20 len =3D seq_buf_used(s); =20 - if (len <=3D s->readpos) + if (len <=3D start) return -EBUSY; =20 - len -=3D s->readpos; + len -=3D start; if (cnt > len) cnt =3D len; - ret =3D copy_to_user(ubuf, s->buffer + s->readpos, cnt); + ret =3D copy_to_user(ubuf, s->buffer + start, cnt); if (ret =3D=3D cnt) return -EFAULT; =20 - cnt -=3D ret; - - s->readpos +=3D cnt; - return cnt; + return cnt - ret; } =20 /** --=20 2.42.0 From nobody Tue Dec 16 23:43:07 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 22DABC001DF for ; Fri, 20 Oct 2023 22:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbjJTW15 (ORCPT ); Fri, 20 Oct 2023 18:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230117AbjJTW1o (ORCPT ); Fri, 20 Oct 2023 18:27:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E57C8D69 for ; Fri, 20 Oct 2023 15:27:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 013B3C4339A; Fri, 20 Oct 2023 22:27:42 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qtxy1-00AQb0-07; Fri, 20 Oct 2023 18:27:41 -0400 Message-ID: <20231020222740.846078267@goodmis.org> User-Agent: quilt/0.66 Date: Fri, 20 Oct 2023 18:27:19 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Jonathan Corbet Subject: [for-next][PATCH 6/6] seq_buf: fix a misleading comment References: <20231020222713.074741220@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: Jonathan Corbet The comment for seq_buf_has_overflowed() says that an overflow condition is marked by len =3D=3D size, but that's not what the code is testing. Make t= he comment match reality. Link: https://lkml.kernel.org/r/87pm19kp0m.fsf@meer.lwn.net Fixes: 8cd709ae7658a ("tracing: Have seq_buf use full buffer") Signed-off-by: Jonathan Corbet Signed-off-by: Steven Rostedt (Google) --- include/linux/seq_buf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h index a0fb013cebdf..8483e4b2d0d2 100644 --- a/include/linux/seq_buf.h +++ b/include/linux/seq_buf.h @@ -36,7 +36,7 @@ seq_buf_init(struct seq_buf *s, char *buf, unsigned int s= ize) =20 /* * seq_buf have a buffer that might overflow. When this happens - * the len and size are set to be equal. + * len is set to be greater than size. */ static inline bool seq_buf_has_overflowed(struct seq_buf *s) --=20 2.42.0