Re: patch for 2.1.80 knfsd

Bill Hawes (
Fri, 23 Jan 1998 11:36:27 -0500

Olaf Kirch wrote:

> I think a better solution would be to just nfsd_fh_flush() the FH cache
> when the last server process exits. The only dentry that will then remain
> at shutdown is the one in exp->ex_dentry.
> This dentry should go entirely, IMHO. The only occasion what it is used
> is when constructing a file handle in exp_rootfh. In that case, we can
> also use lookup_dentry(exp->ex_path, NULL) to get at the dentry. The
> advantage of this is that it lets you export CD-ROMS without having to
> fiddle with exportfs whenever you want to insert a different CD into
> the drive.

Hi Olaf,

I looked through the code for the usage of the ex_dentry, and it's used
for the covered check in vfs.c. This test could probably be replaced
with a (dev, ino) comparison. One potential problem with not holding the
dentry would be that the exported fs could be unmounted, exposing the
underlying directory. I think we would need some additional tests to
guard against this.

Being able to change CDs on the fly would be nice, though in a real
server environment you might have problems with filehandles outstanding
on the old volume, and there will typically be cached dentries if
someone has looked at the CD recently.

Anyway, I think for now it's probably safer to keep the export dentry.