diff options
| author | hilimd <68371223+hilimd@users.noreply.github.com> | 2020-10-14 16:39:45 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-14 16:39:45 +0800 |
| commit | a91137579857a3ef40725dccda85f40d0ac77223 (patch) | |
| tree | ab389cfefe7796600aeaca14773992daf7746752 /weed/filesys/dir.go | |
| parent | 2ff727a32d6d879a49ff5848b592518c96bb6403 (diff) | |
| parent | 1069b325dd92b6a1b16a20290acc8129d5e19ef8 (diff) | |
| download | seaweedfs-a91137579857a3ef40725dccda85f40d0ac77223.tar.xz seaweedfs-a91137579857a3ef40725dccda85f40d0ac77223.zip | |
Merge pull request #26 from chrislusf/master
sync
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 4dede3a8b..ae2ae3418 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -234,7 +234,11 @@ func (dir *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse. fullFilePath := util.NewFullPath(dir.FullPath(), req.Name) dirPath := util.FullPath(dir.FullPath()) - meta_cache.EnsureVisited(dir.wfs.metaCache, dir.wfs, util.FullPath(dirPath)) + visitErr := meta_cache.EnsureVisited(dir.wfs.metaCache, dir.wfs, dirPath) + if visitErr != nil { + glog.Errorf("dir Lookup %s: %v", dirPath, visitErr) + return nil, fuse.EIO + } cachedEntry, cacheErr := dir.wfs.metaCache.FindEntry(context.Background(), fullFilePath) if cacheErr == filer_pb.ErrNotFound { return nil, fuse.ENOENT @@ -296,7 +300,10 @@ func (dir *Dir) ReadDirAll(ctx context.Context) (ret []fuse.Dirent, err error) { } dirPath := util.FullPath(dir.FullPath()) - meta_cache.EnsureVisited(dir.wfs.metaCache, dir.wfs, dirPath) + if err = meta_cache.EnsureVisited(dir.wfs.metaCache, dir.wfs, dirPath); err != nil { + glog.Errorf("dir ReadDirAll %s: %v", dirPath, err) + return nil, fuse.EIO + } listedEntries, listErr := dir.wfs.metaCache.ListDirectoryEntries(context.Background(), util.FullPath(dir.FullPath()), "", false, int(math.MaxInt32)) if listErr != nil { glog.Errorf("list meta cache: %v", listErr) |
