diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index 9b4953e48..6c50ac04a 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -583,16 +583,15 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, fuse.Status) // our IsDirectoryCached check and FindEntry (e.g. markDirectoryReadThrough). // If it's no longer cached, fall through to the filer lookup below. if wfs.metaCache.IsDirectoryCached(dirPath) { - // If the kernel is still tracking this path's inode, the entry - // was known to exist recently; a cached-dir miss here suggests - // metaCache/parent-cache coherence drift. Log visibly so the - // next occurrence shows up in mount.log without -v=4. - if _, inodeFound := wfs.inodeToPath.GetInode(fullpath); inodeFound { - glog.Warningf("lookupEntry: %s missing from cache while parent %s is cached; inode still tracked (possible coherence bug)", fullpath, dirPath) - } else { + // Authoritative ENOENT only if inodeToPath also has no record. + // If the kernel still tracks this inode, the three layers + // disagree; trust the filer over the local cache (the + // filer-ErrNotFound branch below logs the confirmed drift). + if _, inodeFound := wfs.inodeToPath.GetInode(fullpath); !inodeFound { glog.V(4).Infof("lookupEntry cache miss (dir cached) %s", fullpath) + return nil, fuse.ENOENT } - return nil, fuse.ENOENT + glog.V(2).Infof("lookupEntry: %s missing from cache while parent %s is cached; inode tracked, consulting filer", fullpath, dirPath) } }