Subject: Re: ufs-ism in lookup(9)
To: Martin Husemann <martin@duskware.de>
From: Jaromir Dolecek <jdolecek@NetBSD.org>
List: tech-kern
Date: 03/20/2004 12:37:13
Martin Husemann wrote:
> On Sat, Mar 20, 2004 at 08:34:27AM +0100, Jaromir Dolecek wrote:
> > You surely need to do lookup before deleting a file - you are
> > supposed to return ENOENT if it doesn't exist.
> 
> While that's true for local file systems, the suggested optimizations
> certainly sounds right for remote file systems to me.

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.
 
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.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
-=- sometimes levitate or glow.   Do not let this distract you.''   -=-