Thread (14 messages) 14 messages, 2 authors, 2024-02-01

Re: [PATCH v2 4/7] tracefs: dentry lookup crapectomy

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2024-02-01 03:21:14
Also in: linux-fsdevel, lkml, stable

On Thu, 1 Feb 2024 03:02:05 +0000
Al Viro [off-list ref] wrote:
quoted
We had a problem here with just returning NULL. It leaves the negative
dentry around and doesn't get refreshed.  
Why would that dentry stick around?  And how would anyone find
it, anyway, when it's not hashed?
We (Linus and I) got it wrong. It originally had:

	d_add(dentry, NULL);
	[..]
	return NULL;

and it caused the:


  # ls events/kprobes/sched/
ls: cannot access 'events/kprobes/sched/': No such file or directory

  # echo 'p:sched schedule' >> /sys/kernel/tracing/kprobe_events 
  # ls events/kprobes/sched/
ls: cannot access 'events/kprobes/sched/': No such file or directory

I just changed the code to simply return NULL, and it had no issues:

  # ls events/kprobes/sched/
ls: cannot access 'events/kprobes/sched/': No such file or directory

  # echo 'p:sched schedule' >> /sys/kernel/tracing/kprobe_events 
  # ls events/kprobes/sched/
enable  filter  format  hist  hist_debug  id  inject  trigger

But then I added the: d_add(dentry, NULL); that we originally had, and then
it caused the issue again.

So it wasn't the returning NULL that was causing a problem, it was calling
the d_add(dentry, NULL); that was.

I'll update the patch.

-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help