aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-03-21 22:27:30 -0700
committerChris Lu <chris.lu@gmail.com>2021-03-21 22:27:30 -0700
commitdf461402cccd28fc863d78aba3304893ef82f328 (patch)
tree6c1f2630308bcb48881809e8088470331b7463b8
parent102a951377c595062f03cf3a15b765ae733cc0bd (diff)
downloadseaweedfs-df461402cccd28fc863d78aba3304893ef82f328.tar.xz
seaweedfs-df461402cccd28fc863d78aba3304893ef82f328.zip
ensure entry attribute is not nill
fix https://github.com/chrislusf/seaweedfs/issues/1926
-rw-r--r--weed/filesys/file.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index b73cd895b..da93e0fae 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -280,6 +280,9 @@ func (file *File) maybeLoadEntry(ctx context.Context) (entry *filer_pb.Entry, er
return entry, err
}
if entry != nil {
+ if entry.Attributes == nil {
+ entry.Attributes = &filer_pb.FuseAttributes{}
+ }
file.setEntry(entry)
} else {
glog.Warningf("maybeLoadEntry not found entry %s/%s: %v", file.dir.FullPath(), file.Name, err)