Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Revert "avoid possible nil attributes"

chrislu9d44b89c21c9
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go
index caef34ac15..55a29542a9 100644
--- a/weed/mount/weedfs_attr.go
+++ b/weed/mount/weedfs_attr.go
@@ -138,20 +138,18 @@ func (wfs *WFS) setAttrByPbEntry(out *fuse.Attr, inode uint64, entry *filer_pb.E
out.Size = filer.FileSize(entry)
out.Blocks = (out.Size + blockSize - 1) / blockSize
setBlksize(out, blockSize)
- if entry.Attributes != nil {
- out.Mtime = uint64(entry.Attributes.Mtime)
- out.Ctime = uint64(entry.Attributes.Mtime)
- out.Atime = uint64(entry.Attributes.Mtime)
- out.Mode = toSyscallMode(os.FileMode(entry.Attributes.FileMode))
- out.Uid = entry.Attributes.Uid
- out.Gid = entry.Attributes.Gid
- out.Rdev = entry.Attributes.Rdev
- }
+ out.Mtime = uint64(entry.Attributes.Mtime)
+ out.Ctime = uint64(entry.Attributes.Mtime)
+ out.Atime = uint64(entry.Attributes.Mtime)
+ out.Mode = toSyscallMode(os.FileMode(entry.Attributes.FileMode))
if entry.HardLinkCounter > 0 {
out.Nlink = uint32(entry.HardLinkCounter)
} else {
out.Nlink = 1
}
+ out.Uid = entry.Attributes.Uid
+ out.Gid = entry.Attributes.Gid
+ out.Rdev = entry.Attributes.Rdev
}
func (wfs *WFS) setAttrByFilerEntry(out *fuse.Attr, inode uint64, entry *filer.Entry) {