Yes, that would be MUCH cleaner. My current hack keeps all that "silly
files" until the last user iputs the inode and and i_count goes down
to zero. This might lead to hundrets of ".nfs#ino" files. And the
directories that contain those files can't be removed either (dir not
empty).
> Then the NFS code would delete the silly rename where it is appropriate,
> without any hacks (no need to remove the dentry from the hash chains etc
> like Claus did).
Yup, because every "positive" dentry (i.e. d_inode != NULL) prevents
i_count from going down to zero.
> Claus: there was nothing wrong with your patches per se that I could see:
> it's just that I do not want to apply a silly-rename function that does it
> the "wrong" way in my opinion. I'm sure your patches work, and that's
> actually the main problem: if I were to apply something that works but is
> ugly, nobody else would ever be inclined to fix it up the correct way..
No problem, I just got fed up with the current NFS client code
w.r.t. Here scripts etc. And originally I didn't intend to change any
code outside the nfs client code.
> That's why I'm hoping that somebody would add a "delete" function to
> dentry->d_op, and in dput() the first thing it does when it notices that
> d_count goes down to zero it calls dentry->d_op->delete if the function
> exists..
.. which would delete that ".nfs#ino" files (in the case of NFS .. and
change the dentry to be a negative one? Have to look a closer look on
what happens to the unused dentries on the unused list when they get
reused)
> Any takers? Hint, hint..
If this is desired and I find the time, maybe.
Cheers
Claus