proposed dcache changes

Bill Hawes (whawes@star.net)
Mon, 08 Dec 1997 10:55:46 -0500


I have a couple of suggestions for minor changes to the dcache layer
that I'd like to offer for comment.

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.

It is possible that some fs might still need to repeat the
shrink_dcache_parent call, if they have to do a blocking lock operation,
or if the check for empty directories might block. But in many cases
this won't be required.

The second suggestion would help avoid an annoying quirk of the dcache
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.

Regards,
Bill