diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-03-07 16:51:46 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-03-07 16:51:46 -0800 |
| commit | 8645283a7b8a50485390267be9f83b83707f6161 (patch) | |
| tree | 9e3e3f212d918e9fa7b0ac90b6ac9d9d687d0b56 /weed/filesys/xattr.go | |
| parent | 936e7cdbfb02e719058fa341772f2f8afee2a9f1 (diff) | |
| download | seaweedfs-8645283a7b8a50485390267be9f83b83707f6161.tar.xz seaweedfs-8645283a7b8a50485390267be9f83b83707f6161.zip | |
fuse mount: avoid lookup nil entry
fix https://github.com/chrislusf/seaweedfs/issues/1221
Diffstat (limited to 'weed/filesys/xattr.go')
| -rw-r--r-- | weed/filesys/xattr.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/weed/filesys/xattr.go b/weed/filesys/xattr.go index 3ccecdf98..993e7ad93 100644 --- a/weed/filesys/xattr.go +++ b/weed/filesys/xattr.go @@ -1,9 +1,6 @@ package filesys import ( - "context" - "strings" - "github.com/chrislusf/seaweedfs/weed/filer2" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" @@ -124,9 +121,9 @@ func (wfs *WFS) maybeLoadEntry(dir, name string) (entry *filer_pb.Entry, err err Directory: dir, } - resp, err := client.LookupDirectoryEntry(context.Background(), request) - if err != nil || resp == nil || resp.Entry == nil { - if err == filer2.ErrNotFound || strings.Contains(err.Error(), filer2.ErrNotFound.Error()) { + resp, err := filer_pb.LookupEntry(client, request) + if err != nil { + if err == filer2.ErrNotFound { glog.V(3).Infof("file attr read not found file %v: %v", request, err) return fuse.ENOENT } |
