Re: [GIT PULL] vfs fixes

From: Christian Brauner
Date: Tue Mar 19 2024 - 02:58:23 EST


On Mon, Mar 18, 2024 at 12:41:49PM -0700, Linus Torvalds wrote:
> On Mon, 18 Mar 2024 at 12:14, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > IOW, isn't the 'get()' always basically paired with the mounting? And
> > the 'put()' would probably be best done iin kill_block_super()?
>
> .. or alternative handwavy approach:
>
> The fundamental _reason_ for the ->get/put seems to be to make the
> 'holder' lifetime be at least as long as the 'struct file' it is
> associated with. No?
>
> So how about we just make the 'holder' always *be* a 'struct file *'? That
>
> (a) gets rid of the typeless 'void *' part
>
> (b) is already what it is for normal cases (ie O_EXCL file opens).
>
> wouldn't it be lovely if we just made the rule be that 'holder' *is*
> the file pointer, and got rid of a lot of typeless WTF code?
>
> Again, this comment (and the previous email) is more based on "this
> does not feel right to me" than anything else.
>
> That code just makes my skin itch. I can't say it's _wrong_, but it
> just FeelsWrongToMe(tm).

So, initially I think the holder ops were intended to be generic by
Christoph but I agree that it's probably not needed. I just didn't
massage that code yet. Now on my todo for this cycle!