mount: fix nil directory problem

This commit is contained in:
Chris Lu 2019-12-17 15:08:38 -08:00
parent ee6952fddd
commit 9c781da34a

View File

@ -186,7 +186,9 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.
if err != nil {
return nil, err
}
dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute)
if entry != nil {
dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute)
}
} else {
glog.V(4).Infof("dir Lookup cache hit %s", fullFilePath)
}