Re: [PATCH] eventfs: Have inodes have unique inode numbers
From: Linus Torvalds
Date: Sun Jan 28 2024 - 20:00:39 EST
On Sun, 28 Jan 2024 at 16:21, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> >
> > Wouldn't it be bad if the dentry hung around after the rmdir. You don't
> > want to be able to access files after rmdir has finished.
Steven, I already told you that that is NORMAL.
This is how UNIX filesystems work. Try this:
mkdir dummy
cd dummy
echo "Hello" > hello
( sleep 10; cat ) < hello &
rm hello
cd ..
rmdir dummy
and guess what? It will print "hello" after that file has been
removed, and the whole directory is gone.
YOU NEED TO DEAL WITH THIS.
> And thinking about this more, this is one thing that is different with
> eventfs than a normal file system. The rmdir in most cases where
> directories are deleted in eventfs will fail if there's any open files
> within it.
No.
Stop thinking that eventfs is special. It's not.
You need to deal with the realities of having made a filesystem. And
one of those realities is that you don't control the dentries, and you
can't randomly cache dentry state and then do things behind the VFS
layer's back.
So remove that broken function. Really. You did a filesystem, and
that means that you had better play by the VFS rules.
End of discussion.
Now, you can then make your own "read" and "lookup" etc functions say
"if the backing store data has been marked dead, I'll not do this".
That's *YOUR* data structures, and that's your choice.
But you need to STOP thinking you can play games with dentries. And
you need to stop making up BS arguments for why you should be able
to.
So if you are thinking of a "Here's how to do a virtual filesystem"
talk, I would suggest you start with one single word: "Don't".
I'm convinced that we have made it much too easy to do a half-arsed
virtual filesystem. And eventfs is way beyond half-arsed.
It's now gone from half-arsed to "I told you how to do this right, and
you are still arguing". That makes it full-arsed.
So just stop the arsing around, and just get rid of those _broken_ dentry games.
Linus