Re: structure dentry help...

Trond Myklebust (trond.myklebust@fys.uio.no)
Mon, 1 Nov 1999 16:33:17 +0100 (CET)


>>>>> " " == Alexander Viro <viro@math.psu.edu> writes:

> On 1 Nov 1999, Trond Myklebust wrote:

>> BTW: Why does the d_alias stop us handling > 1 dentry for a
>> directory? In particular for NFS this is a bug, since the
>> statelessness requirement, means you cannot assume that renames
>> etc. won't happen behind your back. I've been trying to get rid
>> of all that code that tries to second-guess the filesystem
>> state on the server.

> Check what happens if you get different pathes to the same
> place. Consider the following picture:

a-> b ->c ->d
-> b'->c'->d'

> Now, remove d. shrink_dcache_parent will not help
> here. Moreover, there are problems with inconsistent dcache
> state - stale dentries and all such. It's simply not supposed
> to work that way.

The problem here is that the stateless client/server model of NFS
forces us into this sort of situation. Staleness checking etc in the
NFS model is the responsability of the server, not the client.

In your testcase, if you remove "d", the server will report the
handle for "d'" as being stale the next time you try to use it. The
only thing you lose by allowing aliased directory trees is the
'guarantee' as to whether it is safe to delete something or not. Such
a guarantee can in any case not be given under the NFS model.

Consider

client (Process 1) client (Process 2) server

cd ~/a
open (somefile, O_RDWR)
cd ~
mv a b
cd ~/b
open (somefile, O_RDONLY)
rm -rf b

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/