diff options
| author | chrislu <chris.lu@gmail.com> | 2022-01-12 19:31:25 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-01-12 19:31:25 -0800 |
| commit | b44f05a2d0696578bef093c39cb981883285ec95 (patch) | |
| tree | 5579a995d85018ec462b5b36928ce53c66da3432 /weed/filesys/file.go | |
| parent | 15c01d8b7fa680bfc910538d3dc2ac90a7472d9d (diff) | |
| download | seaweedfs-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.go | 4 |
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 } |
