aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-04-16 22:56:45 -0700
committerchrislu <chris.lu@gmail.com>2022-04-16 22:56:45 -0700
commitb597baf488fa4449d41ac2b78d421751f65f909e (patch)
tree963997bc58a9feaa91243fc01384c551fd83f694 /weed
parent460d56d2832a1898adad8f1bd83e9a077acd6fd2 (diff)
downloadseaweedfs-b597baf488fa4449d41ac2b78d421751f65f909e.tar.xz
seaweedfs-b597baf488fa4449d41ac2b78d421751f65f909e.zip
mount: set file write time correct to work well with rsync
fix https://github.com/chrislusf/seaweedfs/issues/2867
Diffstat (limited to 'weed')
-rw-r--r--weed/mount/weedfs_attr.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go
index 55a29542a..cb935d0e4 100644
--- a/weed/mount/weedfs_attr.go
+++ b/weed/mount/weedfs_attr.go
@@ -98,15 +98,14 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
}
}
- if mtime, ok := input.GetMTime(); ok {
- entry.Attributes.Mtime = mtime.Unix()
- }
-
if atime, ok := input.GetATime(); ok {
entry.Attributes.Mtime = atime.Unix()
}
- entry.Attributes.Mtime = time.Now().Unix()
+ if mtime, ok := input.GetMTime(); ok {
+ entry.Attributes.Mtime = mtime.Unix()
+ }
+
out.AttrValid = 1
wfs.setAttrByPbEntry(&out.Attr, input.NodeId, entry)