diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go index 4042ce8f1..9f995608c 100644 --- a/weed/mount/weedfs_attr.go +++ b/weed/mount/weedfs_attr.go @@ -66,7 +66,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse } if mode, ok := input.GetMode(); ok { - entry.Attributes.FileMode = uint32(mode) + entry.Attributes.FileMode = mode & 07777 } if uid, ok := input.GetUID(); ok { @@ -81,6 +81,10 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse entry.Attributes.Mtime = mtime.Unix() } + if atime, ok := input.GetATime(); ok { + entry.Attributes.Mtime = atime.Unix() + } + entry.Attributes.Mtime = time.Now().Unix() out.AttrValid = 1 wfs.setAttrByPbEntry(&out.Attr, input.NodeId, entry) diff --git a/weed/mount/weedfs_file_mkrm.go b/weed/mount/weedfs_file_mkrm.go index 6c06e1947..9e19c8b54 100644 --- a/weed/mount/weedfs_file_mkrm.go +++ b/weed/mount/weedfs_file_mkrm.go @@ -45,7 +45,7 @@ func (wfs *WFS) Mknod(cancel <-chan struct{}, in *fuse.MknodIn, name string, out Attributes: &filer_pb.FuseAttributes{ Mtime: time.Now().Unix(), Crtime: time.Now().Unix(), - FileMode: uint32(toFileMode(in.Mode) &^ wfs.option.Umask), + FileMode: uint32(toFileMode(in.Mode)), Uid: in.Uid, Gid: in.Gid, Collection: wfs.option.Collection, diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go index 29a13690b..8fb7c73b4 100644 --- a/weed/mount/weedfs_file_sync.go +++ b/weed/mount/weedfs_file_sync.go @@ -7,7 +7,6 @@ import ( "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/hanwen/go-fuse/v2/fuse" - "os" "time" ) @@ -129,7 +128,6 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status { entry.Attributes.Crtime = time.Now().Unix() } entry.Attributes.Mtime = time.Now().Unix() - entry.Attributes.FileMode = uint32(os.FileMode(entry.Attributes.FileMode) &^ wfs.option.Umask) entry.Attributes.Collection, entry.Attributes.Replication = fh.dirtyPages.GetStorageOptions() } diff --git a/weed/mount/weedfs_symlink.go b/weed/mount/weedfs_symlink.go index 44477d765..eb8169d70 100644 --- a/weed/mount/weedfs_symlink.go +++ b/weed/mount/weedfs_symlink.go @@ -32,7 +32,7 @@ func (wfs *WFS) Symlink(cancel <-chan struct{}, header *fuse.InHeader, target st Attributes: &filer_pb.FuseAttributes{ Mtime: time.Now().Unix(), Crtime: time.Now().Unix(), - FileMode: uint32((os.FileMode(0777) | os.ModeSymlink) &^ wfs.option.Umask), + FileMode: uint32(os.FileMode(0777) | os.ModeSymlink), Uid: header.Uid, Gid: header.Gid, SymlinkTarget: target,