public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Li Zhong <floridsleeves@gmail.com>
Subject: Re: [PATCH] tracing: Check the return value of tracing_update_buffers()
Date: Thu, 8 Jan 2026 23:44:35 +0900	[thread overview]
Message-ID: <20260108234435.c848eb17889b760f42c435aa@kernel.org> (raw)
In-Reply-To: <20260107161510.4dc98b15@gandalf.local.home>

On Wed, 7 Jan 2026 16:15:10 -0500
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: Steven Rostedt <rostedt@goodmis.org>
> 
> In the very unlikely event that tracing_update_buffers() fails in
> trace_printk_init_buffers(), report the failure so that it is known.
> 
> Link: https://lore.kernel.org/all/20220917020353.3836285-1-floridsleeves@gmail.com/

Good catch! Looks good to me.

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks,

> 
> Suggested-by: Li Zhong <floridsleeves@gmail.com>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
>  kernel/trace/trace.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 2d387d56dcd4..1722e01e2238 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -3418,9 +3418,10 @@ void trace_printk_init_buffers(void)
>  	pr_warn("**********************************************************\n");
>  
>  	/* Expand the buffers to set size */
> -	tracing_update_buffers(&global_trace);
> -
> -	buffers_allocated = 1;
> +	if (tracing_update_buffers(&global_trace) < 0)
> +		pr_err("Failed to expand tracing buffers for trace_printk() calls\n");
> +	else
> +		buffers_allocated = 1;
>  
>  	/*
>  	 * trace_printk_init_buffers() can be called by modules.
> -- 
> 2.51.0
> 
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2026-01-08 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-07 21:15 [PATCH] tracing: Check the return value of tracing_update_buffers() Steven Rostedt
2026-01-08 14:44 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260108234435.c848eb17889b760f42c435aa@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=floridsleeves@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox