mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: no entry if not found
This commit is contained in:
parent
e4b660699f
commit
230a0e4a33
|
@ -184,7 +184,8 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.
|
||||||
glog.V(3).Infof("dir Lookup cache miss %s", fullFilePath)
|
glog.V(3).Infof("dir Lookup cache miss %s", fullFilePath)
|
||||||
entry, err = filer2.GetEntry(ctx, dir.wfs, fullFilePath)
|
entry, err = filer2.GetEntry(ctx, dir.wfs, fullFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
glog.V(1).Infof("dir GetEntry %s: %v", fullFilePath, err)
|
||||||
|
return nil, fuse.ENOENT
|
||||||
}
|
}
|
||||||
if entry != nil {
|
if entry != nil {
|
||||||
dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute)
|
dir.wfs.listDirectoryEntriesCache.Set(fullFilePath, entry, 5*time.Minute)
|
||||||
|
@ -390,9 +391,6 @@ func (dir *Dir) maybeLoadEntry(ctx context.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if entry == nil {
|
|
||||||
return fuse.ENOENT
|
|
||||||
}
|
|
||||||
dir.entry = entry
|
dir.entry = entry
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -125,15 +125,13 @@ func (wfs *WFS) maybeLoadEntry(ctx context.Context, dir, name string) (entry *fi
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := client.LookupDirectoryEntry(ctx, request)
|
resp, err := client.LookupDirectoryEntry(ctx, request)
|
||||||
if err != nil {
|
if err != nil || resp == nil || resp.Entry == nil {
|
||||||
glog.V(3).Infof("file attr read file %v: %v", request, err)
|
glog.V(3).Infof("file attr read file %v: %v", request, err)
|
||||||
return fuse.ENOENT
|
return fuse.ENOENT
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = resp.Entry
|
entry = resp.Entry
|
||||||
if entry != nil {
|
wfs.listDirectoryEntriesCache.Set(fullpath, entry, wfs.option.EntryCacheTtl)
|
||||||
wfs.listDirectoryEntriesCache.Set(fullpath, entry, wfs.option.EntryCacheTtl)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue