[Prev][Next][Index][Thread]

Bug with the fsnamespace cache ???



	Hi,

The fsnamepsace implementation in OSKit uses a cache to speed up lookups
for files with hash tables. In the cache implementation we can read that
an unlink on a file must be notified to the cache to purge the cache entry.

But the unlink() implementation in the posix library does not used the
fsn_cache_remove() function to remove the file from the cache. So the
cache keeps a reference on the file and the file cannot be destroyed by
the call to oskit_dir_unlink() (an external reference on the file is kept).

I think unlink() in the POSIX library is not wrong. Everyone can expect
that a call to oskit_dir_unlink() will remove the file from the
filesystem, but as a reference is kept on it by the fsnamespace cache, it
is not really removed : a call to open() on the same file will hit in the
cache and the file will be returned to the caller. The removal will not
have been seen by the cache !

Shortly: references are kept on files when they must not be kept, because
the implementation of memfs (and my implementation of the NFS client)
consider that a file still exists when references on them are kept
somewhere.

Am I wrong ? Is there something I should do to solve my problem.
Thank you.

	Simon.