Re: attempt to re-implement sillyrename for NFS in 2.1.*

Linus Torvalds (torvalds@transmeta.com)
Fri, 22 Aug 1997 09:57:55 -0700 (PDT)


On Fri, 22 Aug 1997, Bill Hawes wrote:
>
> Claus-Justus Heine wrote:
> > The reason for those errors is the missing support for that
> > "sillyrename" stuff that we had with the 2.0.* implementation of the
> > nfs code.
> >
> > I dared to try to re-implement it.
>
> I was also thinking of re-implementing the sillyrename, but I'm very
> glad you did it instead :-)
>
> One suggestion though ... I think it would be better for you to move the
> sillyrename_cleanup to delete_inode. The main reason is that the
> cleanup will block, possibly for quite a while, allowing the possibility
> of the inode being put back in service. This has been a long-standing
> race problem with put_inode.

No.

The problem is that "sillyrename_cleanup" has nothing to do with the
inode. It depends _only_ on the 'dentry'. The inode may be around
(indefinitely) with a non-zero count for hardlinks etc..

This is why I haven't applied Claus-Justus' patches: they tried to handle
this, but I don't like the way it was done. I think we should just add a
"delete" (or "forget") function to the "dentry_operations" structure
block, and call that from dput() when we put the last copy of the dentry.

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).

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..

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..

Any takers? Hint, hint..

Linus