NFS mode changes

Bill Hawes (whawes@star.net)
Thu, 30 Oct 1997 13:02:17 -0500


I've tracked down one cause of the inode mode changes noted in NFS. If
we have a local reference to a directory (dentry d_count > 1) when doing
a nfs_rmdir, the directory is removed on the server, but the inode is
retained locally. A subsequent reference to the directory will generate
either a stale filehandle or mode change error, depending on whether the
fileid (inode number) has been reused. I've been able to trigger this
with two simple scripts running concurrently.

As this is basically the same issue that prompted the use of
silly-rename for files, we could handle it similarly -- maybe use a
different silly name stem for the directories. Alternatively (and
simpler) is to just check for d_count > 1 and return EBUSY. I've added
this to my sources, and it stops the mode changes, but might have side
effects if some software depends on removing directories still in use.

Anyway, we need to handle it in some fashion, as the mode change error
is meant only to catch irrecoverable errors. (E.g. someone messing
around on the server behind our backs.)

Regards,
Bill