Agreed.
> in the event of certain errors. If a create operation (mkdir, mknod,
> etc.) fails, we currently keep a negative dentry for the name in
> question. In some cases this can interfere with recovery -- e.g. a
> script may attempt to delete the entry, but this will fail because the
> object doesn't exist locally. It's particularly a problem with network
> filesystems if the operation can succeed on the server but fail in the
> return path.
>
> Dropping the dentry after such failed operations would make it easier
> for later attempts to recover without having the negative dentry to
> block subsequent lookups. NFS client is currently doing this, but I
> think it would be useful as a general policy.
You may well be right. I like the negative dentries, but it may well be
prudent to only create a negative dentry at lookup time, never when
removing dentries.
However, I think this should be a per-filesystem decision like it is now.
For network filesystems you definitely want to drop them, but for local
filesystems the current behaviour is potentially faster.
Linus