Browse Source

fix nil problem

pull/1153/head
Chris Lu 5 years ago
parent
commit
40ff4eea14
  1. 5
      weed/filer2/filer_client_util.go
  2. 3
      weed/filesys/dir.go

5
weed/filer2/filer_client_util.go

@ -112,11 +112,12 @@ func GetEntry(ctx context.Context, filerClient FilerClient, fullFilePath string)
return err
}
if resp.Entry != nil {
entry = resp.Entry
if resp.Entry == nil {
glog.V(3).Infof("read %s entry: %v", fullFilePath, entry)
return nil
}
entry = resp.Entry
return nil
})

3
weed/filesys/dir.go

@ -56,6 +56,9 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error {
glog.V(2).Infof("read dir %s attr: %v, error: %v", dir.Path, dir.attributes, err)
return err
}
if entry == nil {
return fuse.ENOENT
}
dir.attributes = entry.Attributes
glog.V(2).Infof("dir %s: %v perm: %v", dir.Path, dir.attributes, os.FileMode(dir.attributes.FileMode))

Loading…
Cancel
Save