lkml.org 
[lkml]   [2024]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/7] tracefs: dentry lookup crapectomy
On Thu, 1 Feb 2024 03:02:05 +0000
Al Viro <viro@zeniv.linux.org.uk> wrote:

> > 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

\
 
 \ /
  Last update: 2024-05-27 14:44    [W:0.048 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site