mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: menglong.dong@linux.dev
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] tracing: fprobe: Fix to remove recorded module addresses from filter
Date: Wed, 24 Sep 2025 17:10:58 +0900	[thread overview]
Message-ID: <20250924171058.15fe8364253fb8c42d5f0197@kernel.org> (raw)
In-Reply-To: <9510801.CDJkKcVGEf@7940hx>

On Wed, 24 Sep 2025 11:49:39 +0800
menglong.dong@linux.dev wrote:

> On 2025/9/24 08:26 Masami Hiramatsu (Google) <mhiramat@kernel.org> write:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > 
> > Even if there is a memory allocation failure in fprobe_addr_list_add(),
> > there is a partial list of module addresses. So remove the recorded
> > addresses from filter if exists.
> > This also removes the redundant ret local variable.
> > 
> > Fixes: a3dc2983ca7b ("tracing: fprobe: Cleanup fprobe hash when module unloading")
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > ---
> >  kernel/trace/fprobe.c |    7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Hi, Masami. Should I send the V2 of the patch:
> 
>   tracing: fprobe: optimization for entry only case
> 
> after this series applied?

Yeah, I'll push this [2/2] to stable tonight. and
push [1/2] to probes/for-next too. I'll rebase probes/for-next
so that it will have both patch.

Thank you,

> 
> Thanks!
> Menglong Dong
> 
> > 
> > diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> > index 12ec194fdfed..95e43814b85b 100644
> > --- a/kernel/trace/fprobe.c
> > +++ b/kernel/trace/fprobe.c
> > @@ -434,8 +434,9 @@ static int fprobe_addr_list_add(struct fprobe_addr_list *alist, unsigned long ad
> >  {
> >  	unsigned long *addrs;
> >  
> > -	if (alist->index >= alist->size)
> > -		return -ENOMEM;
> > +	/* Previously we failed to expand the list. */
> > +	if (alist->index == alist->size)
> > +		return -ENOSPC;
> >  
> >  	alist->addrs[alist->index++] = addr;
> >  	if (alist->index < alist->size)
> > @@ -497,7 +498,7 @@ static int fprobe_module_callback(struct notifier_block *nb,
> >  	} while (node == ERR_PTR(-EAGAIN));
> >  	rhashtable_walk_exit(&iter);
> >  
> > -	if (alist.index < alist.size && alist.index > 0)
> > +	if (alist.index > 0)
> >  		ftrace_set_filter_ips(&fprobe_graph_ops.ops,
> >  				      alist.addrs, alist.index, 1, 0);
> >  	mutex_unlock(&fprobe_mutex);
> > 
> > 
> > 
> 
> 
> 
> 


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

  reply	other threads:[~2025-09-24  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-24  0:26 [PATCH 1/2] tracing: fprobe: Remove unused local variable Masami Hiramatsu (Google)
2025-09-24  0:26 ` [PATCH 2/2] tracing: fprobe: Fix to remove recorded module addresses from filter Masami Hiramatsu (Google)
2025-09-24  1:55   ` menglong.dong
2025-09-24  3:49   ` menglong.dong
2025-09-24  8:10     ` Masami Hiramatsu [this message]
2025-09-24  1:22 ` [PATCH 1/2] tracing: fprobe: Remove unused local variable menglong.dong

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=20250924171058.15fe8364253fb8c42d5f0197@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=menglong.dong@linux.dev \
    --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

all inboxes | Powered by JetHome®