Re: knfsd and system crashes

Alan Cox (alan@lxorguk.ukuu.org.uk)
Thu, 13 Nov 1997 13:05:09 +0000 (GMT)


> parent-inode/inode; after doing a search we have a dentry. But the
> client will continue to talk to the server using the original handle,
> which has the original long-expired (or reused) dentry. There's no
> provision to tell a client, "here, use this filehandle now".
>
> Possibly I can find a way to cache the secondary lookup info by (parent
> inode, inode) to avoid repeating the full search ...

Suppose we change the way we play the game a fraction and the NFS daemon
allocates some blocks of "index pages" according to system memory/load
whatever.

On the filehandle you provide an index value. We take that value and
do something like

base=handle&255;
offset=(handle0x3FF00)>>8; /* 1K */

We now make

dentry **base[256];

and each pointer points to 1 page which is a page of dentry pointers.

At boot we may well allocate a lot less than 256 pages but we set the pointers
to point to share pages across multiple entries.

This means we can now do

dentry=find_dentry(base,offset);
if(inode_of(dentry)!=handle->inode && [ other tests here ])
{
dentry=find_dentry(...)
store_dentry(base,offset,dentry)
}

and find_dentry might even magic up stuff - either by searching or by
using an "open by inode" hack. We can now at least cache the most recent
dentry matching a base,offset hash - and it could be made a better cache
algorithm if appropriate

Alan