Re: NFS Client patch

Trond Myklebust (trond.myklebust@fys.uio.no)
Mon, 9 Jul 2001 22:05:30 +0200


>>>>> " " == Craig Soules <soules@happyplace.pdl.cmu.edu> writes:

>> Your patch will automatically lead to duplicate entries in
>> readdir() on most if not all servers whenever the attributes on
>> the inode have been refreshed (whether or not the cache has
>> been invalidated). That's a bug...

> If I were to do a create during a readdir() operation which
> inserted itself in the directory before the place it left off,
> that entry would be left out of the listing. That is also a
> bug, wouldn't you think?

No: it's POSIX

If the client discovers that the cache is invalid, it clears it, and
refills the cache. We then start off at the next cookie after the last
read cookie. Test it on an ordinary filesystem and you'll see the
exact same behaviour. The act of creating or deleting files is *not*
supposed invalidate the readdir offset.

You are confusing the act of detecting whether or not the cache is
invalid with that of recovering after a cache invalidation. In the
former case we do have room for improvement: see for instance

http://www.fys.uio.no/~trondmy/src/2.4.6/linux-2.4.6-cto.dif

which strengthens the attribute checking on open().

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