Subject: Re: ufs-ism in lookup(9)
To: None <jdolecek@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 03/21/2004 02:13:14
hi,

> Well, it's change of semantics - if we want to consistently
> return ENOENT, we need to check if the file was not removed
> on remove fileserver, thus we cannot use our local cache.

it depends on the protocol being used.
for nfsv3, ENOENT on REMOVE isn't reliable anyway.
(consider that a reply to REMOVE has been lost and we retransmit.)

> Also, AFAICS the non-cached lookup might be necessary so that
> we'd ignore any negative cache entry we might have, so that
> following steps would really remove the file:
> 
> 1. do local lookup (ls 'file')
> 2. some other client creates 'file'
> 3. rm 'file'
>
> Though NFS code might actually check if the entry returned
> by cache_lookup() is still valid, so the negative cache entry
> would be ignored nevertheless.

yes, nfs code has heuristics which work in most cases.

YAMAMOTO Takashi