Re: proposed dcache changes

Linus Torvalds (torvalds@transmeta.com)
Mon, 8 Dec 1997 10:27:03 -0800 (PST)


On Mon, 8 Dec 1997, Bill Hawes wrote:
>
> The first is to do a shrink_dcache_parent() in the generic rmdir code
> before calling the fs-specific operation. All filesystems that I'm aware
> of will want to do this before checking for empty/non-busy directories,
> so it seems like it would be a useful addition.

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