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/dir.go | |
| parent | 15c01d8b7fa680bfc910538d3dc2ac90a7472d9d (diff) | |
| download | seaweedfs-b44f05a2d0696578bef093c39cb981883285ec95.tar.xz seaweedfs-b44f05a2d0696578bef093c39cb981883285ec95.zip | |
POSIX: change timestamp on each attribute change
Diffstat (limited to 'weed/filesys/dir.go')
| -rw-r--r-- | weed/filesys/dir.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index 7701e7de9..79981259f 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -66,7 +66,7 @@ func (dir *Dir) Attr(ctx context.Context, attr *fuse.Attr) error { attr.Mode = os.FileMode(entry.Attributes.FileMode) | os.ModeDir attr.Mtime = time.Unix(entry.Attributes.Mtime, 0) attr.Crtime = time.Unix(entry.Attributes.Crtime, 0) - attr.Ctime = time.Unix(entry.Attributes.Crtime, 0) + attr.Ctime = time.Unix(entry.Attributes.Mtime, 0) attr.Atime = time.Unix(entry.Attributes.Mtime, 0) attr.Gid = entry.Attributes.Gid attr.Uid = entry.Attributes.Uid @@ -515,6 +515,8 @@ func (dir *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fus entry.Attributes.Mtime = req.Mtime.Unix() } + entry.Attributes.Mtime = time.Now().Unix() + return dir.saveEntry(entry) } |
