Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 14:14, Al Viro wrote: > > On Wed, Jan 03, 2024 at 01:54:36PM -0800, Linus Torvalds wrote: > > > Again: UNTESTED, and meant as a "this is another way to avoid messing > > with the dentry tree manually, and just using the VFS interfaces we > > already have" > > That would

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Al Viro
On Wed, Jan 03, 2024 at 01:54:36PM -0800, Linus Torvalds wrote: > Again: UNTESTED, and meant as a "this is another way to avoid messing > with the dentry tree manually, and just using the VFS interfaces we > already have" That would break chown(), though. From conversation back in November:

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 14:04, Steven Rostedt wrote: > > I actually have something almost working too. Here's the WIP. It only works > for tracefs, and now eventfs needs to be updated as the "events" directory > no longer has the right ownership. So I need a way to link the eventfs > entries to use

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 13:54, Linus Torvalds wrote: > > Here's an updated patch that builds, and is PURELY AN EXAMPLE. Oh, and while doing this patch, I found another bug in tracefs, although it happily is one that doesn't have any way to trigger. Tracefs has code like this: if

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Steven Rostedt
On Wed, 3 Jan 2024 13:54:36 -0800 Linus Torvalds wrote: > On Wed, 3 Jan 2024 at 11:57, Linus Torvalds > wrote: > > > > Or, you know, you could do what I've told you to do at least TEN TIMES > > already, which is to not mess with any of this, and just implement the > > '->permission()' callback

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 11:57, Linus Torvalds wrote: > > Or, you know, you could do what I've told you to do at least TEN TIMES > already, which is to not mess with any of this, and just implement the > '->permission()' callback (and getattr() to just make 'ls' look sane > too, rather than silently

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 11:52, Steven Rostedt wrote: > > This doesn't work because for tracefs (not eventfs) the dentries are > created at boot up and before the file system is mounted. This means you > can't even set a gid in /etc/fstab. This will cause a regression. Which is why I suggested

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Steven Rostedt
On Wed, 3 Jan 2024 10:38:09 -0800 Linus Torvalds wrote: > @@ -332,10 +255,8 @@ static int tracefs_apply_options(struct super_block *sb, > bool remount) > if (!remount || opts->opts & BIT(Opt_uid)) > inode->i_uid = opts->uid; > > - if (!remount || opts->opts &

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 10:50, Steven Rostedt wrote: > I think these changes are a bit much for -rc8, don't you? Oh, absolutely. None of this is rc8 material apart from the oops fix in your pull request (which my patch that then removes the whole function did *not* have - so that patch won't

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Steven Rostedt
On Wed, 3 Jan 2024 10:38:09 -0800 Linus Torvalds wrote: > On Wed, 3 Jan 2024 at 10:12, Linus Torvalds > wrote: > > > > Much better. Now eventfs looks more like a real filesystem, and less > > like an eldritch horror monster that is parts of dcache tackled onto a > > pseudo-filesystem. > >

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 10:12, Linus Torvalds wrote: > > Much better. Now eventfs looks more like a real filesystem, and less > like an eldritch horror monster that is parts of dcache tackled onto a > pseudo-filesystem. Oh, except I think you still need to just remove the 'set_gid()' mess. It's

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Steven Rostedt
On Wed, 3 Jan 2024 10:12:08 -0800 Linus Torvalds wrote: > On Wed, 3 Jan 2024 at 07:24, Steven Rostedt wrote: > > > > Instead, just have eventfs have its own iterate_shared callback function > > that will fill in the dent entries. This simplifies the code quite a bit. > > Much better. Now

Re: [PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Linus Torvalds
On Wed, 3 Jan 2024 at 07:24, Steven Rostedt wrote: > > Instead, just have eventfs have its own iterate_shared callback function > that will fill in the dent entries. This simplifies the code quite a bit. Much better. Now eventfs looks more like a real filesystem, and less like an eldritch horror

[PATCH] eventfs: Stop using dcache_readdir() for getdents()

2024-01-03 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The eventfs creates dynamically allocated dentries and inodes. Using the dcache_readdir() logic for its own directory lookups requires hiding the cursor of the dcache logic and playing games to allow the dcache_readdir() to still have access to the cursor while