diff options
| author | chrislu <chris.lu@gmail.com> | 2022-04-06 10:01:45 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-04-06 10:01:45 -0700 |
| commit | 9d44b89c21c973e88ffd1bf2287e635dcd2a7f2e (patch) | |
| tree | 322b263f24dcd5560397a8c2fa6b0a0112cb60ef | |
| parent | 368d8e1a81b0c3844587acd56afad43d1f65c1c8 (diff) | |
| download | seaweedfs-9d44b89c21c973e88ffd1bf2287e635dcd2a7f2e.tar.xz seaweedfs-9d44b89c21c973e88ffd1bf2287e635dcd2a7f2e.zip | |
Revert "avoid possible nil attributes"
This reverts commit 0a6703c7f7c0341f436b2d31745a85108127cec4.
| -rw-r--r-- | weed/mount/weedfs_attr.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go index caef34ac1..55a29542a 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) { |
