On 08/18/2017 11:39 PM, Soumya Koduri wrote:
Hi Frank,
While I was scanning through readdir code path I noticed that we do
create cache entry for each of the dirent (if not present) in the chunk
as part of cbk - "mdc_readdir_chunked_cb()". But there is a repetitive
check right after that (in "mdcache_readdir_chunked()") to verify if all
those entries exist in cache or not.
Could you please clarify if that double check is necessary. Can there be
any case where in we have chunk read (from FSAL or cache) but the
dirents/entries are not yet cached?
If I'm looking at the same code you're worried about, yes, since the
populate (which calls mdc_readdir_chunked_cb()) may not be called, if
the cache is valid. However, the entry itself may have been reaped in
the interim, so the lookup is necessary.
Also it is followed by getattrs() call which seem to have been made
unconditionally though the attributes have just been fetched as part of
FSAL readdir call and are still valid. Can we add a check if the attrs
are indeed expired before re-fetching them?
This should be fine. It's calling getattrs() on the entry handle (not
the sub-handle), so it's calling mdcache_getattrs(), which checks to see
if it's valid and only refreshes if it's not.
Again, this is necessary since we don't refresh the dirents every time,
so the entry may have out-of-date attributes.
Daniel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel