Re: [GIT PULL] tracing: Fixes for 6.6-rc2

From: Linus Torvalds
Date: Sun Sep 24 2023 - 17:09:30 EST


On Sat, 23 Sept 2023 at 16:14, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> - Fix a bug in eventfs where reading a dynamic event directory (open) and then
> creating a dynamic event that goes into that diretory screws up the accounting.

Honestly, I'm getting more and more convinced that you just need to
stop this eventfs stuff.

This is just *incredibly* ugly:

/*
* This just sets the file->private_data back to the cursor and back.
*/
static int dcache_readdir_wrapper(struct file *file, struct dir_context *ctx)
{
struct dentry_list *dlist = file->private_data;
int ret;

file->private_data = dlist->cursor;
ret = dcache_readdir(file, ctx);
dlist->cursor = file->private_data;
file->private_data = dlist;
return ret;
}

I guess it works by the f_pos locking magic, but by christ is this
ugly beyond words.

Honestly, now, are the eventfs changes *really* making up for this
kind of continual "this is crazy" garbage? We had the whole "this is
undebuggable" discussion, now there's stuff like this.

Were people even *aware* of the f_pos locking, or did this just happen to work?

And that's entirely ignoring the disgusting thing that is that
"allocate an array of every dentry we looked at" issue. Which honestly
also looks disgusting.

I beg of you: think hard about just reverting all the eventfs changes
that moved away from using dentries natively, and instead started
doing these *incredibly* hacky and ugly things.

Really.

Linus