aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/file.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-01-12 19:31:25 -0800
committerchrislu <chris.lu@gmail.com>2022-01-12 19:31:25 -0800
commitb44f05a2d0696578bef093c39cb981883285ec95 (patch)
tree5579a995d85018ec462b5b36928ce53c66da3432 /weed/filesys/file.go
parent15c01d8b7fa680bfc910538d3dc2ac90a7472d9d (diff)
downloadseaweedfs-b44f05a2d0696578bef093c39cb981883285ec95.tar.xz
seaweedfs-b44f05a2d0696578bef093c39cb981883285ec95.zip
POSIX: change timestamp on each attribute change
Diffstat (limited to 'weed/filesys/file.go')
-rw-r--r--weed/filesys/file.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index 7b5b5a424..e971aa2e0 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -149,21 +149,25 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f
if req.Valid.Mode() && entry.Attributes.FileMode != uint32(req.Mode) {
entry.Attributes.FileMode = uint32(req.Mode)
+ entry.Attributes.Mtime = time.Now().Unix()
file.dirtyMetadata = true
}
if req.Valid.Uid() && entry.Attributes.Uid != req.Uid {
entry.Attributes.Uid = req.Uid
+ entry.Attributes.Mtime = time.Now().Unix()
file.dirtyMetadata = true
}
if req.Valid.Gid() && entry.Attributes.Gid != req.Gid {
entry.Attributes.Gid = req.Gid
+ entry.Attributes.Mtime = time.Now().Unix()
file.dirtyMetadata = true
}
if req.Valid.Crtime() {
entry.Attributes.Crtime = req.Crtime.Unix()
+ entry.Attributes.Mtime = time.Now().Unix()
file.dirtyMetadata = true
}