diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-01-15 19:08:54 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-01-15 19:08:54 -0800 |
| commit | 230a0e4a333699f9622a418ee7e4f91befa00bfa (patch) | |
| tree | 9da6d8c0308d19cd785ac5c7ed4222e30c9a2c4b /weed/filesys/xattr.go | |
| parent | e4b660699f0e49944c8e951cb552d215da29471f (diff) | |
| download | seaweedfs-230a0e4a333699f9622a418ee7e4f91befa00bfa.tar.xz seaweedfs-230a0e4a333699f9622a418ee7e4f91befa00bfa.zip | |
filer: no entry if not found
Diffstat (limited to 'weed/filesys/xattr.go')
| -rw-r--r-- | weed/filesys/xattr.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/filesys/xattr.go b/weed/filesys/xattr.go index 3c0ba164a..23775cec9 100644 --- a/weed/filesys/xattr.go +++ b/weed/filesys/xattr.go @@ -125,15 +125,13 @@ func (wfs *WFS) maybeLoadEntry(ctx context.Context, dir, name string) (entry *fi } 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) return fuse.ENOENT } entry = resp.Entry - if entry != nil { - wfs.listDirectoryEntriesCache.Set(fullpath, entry, wfs.option.EntryCacheTtl) - } + wfs.listDirectoryEntriesCache.Set(fullpath, entry, wfs.option.EntryCacheTtl) return nil }) |
