diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-12-13 10:35:23 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-12-13 10:35:23 -0800 |
| commit | deb249736e1272b841208d101901cd4616f5f5c0 (patch) | |
| tree | b602ebd4188bc692395c30da91be8b9dcff5f48b /weed/filesys/dir.go | |
| parent | f59119cd1d298c527f9467962e8b480672a414bd (diff) | |
| download | seaweedfs-deb249736e1272b841208d101901cd4616f5f5c0.tar.xz seaweedfs-deb249736e1272b841208d101901cd4616f5f5c0.zip | |
fix nill
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 8f1bc72a7..ad37d9ce0 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -41,10 +41,12 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { } item := dir.wfs.listDirectoryEntriesCache.Get(dir.Path) + var entry *filer_pb.Entry if item != nil && !item.Expired() { + entry = item.Value().(*filer_pb.Entry) + } - glog.V(4).Infof("dir Attr cache hit %s", dir.Path) - + if entry != nil { entry := item.Value().(*filer_pb.Entry) attr.Mtime = time.Unix(entry.Attributes.Mtime, 0) |
