POSIX: adjust ctime for file truncate
This commit is contained in:
@@ -68,6 +68,7 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) {
|
|||||||
glog.V(4).Infof("file Attr %s, open:%v, size: %d", file.fullpath(), file.isOpen, attr.Size)
|
glog.V(4).Infof("file Attr %s, open:%v, size: %d", file.fullpath(), file.isOpen, attr.Size)
|
||||||
}
|
}
|
||||||
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
|
attr.Crtime = time.Unix(entry.Attributes.Crtime, 0)
|
||||||
|
attr.Ctime = time.Unix(entry.Attributes.Mtime, 0)
|
||||||
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
|
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
|
||||||
attr.Gid = entry.Attributes.Gid
|
attr.Gid = entry.Attributes.Gid
|
||||||
attr.Uid = entry.Attributes.Uid
|
attr.Uid = entry.Attributes.Uid
|
||||||
@@ -141,6 +142,7 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f
|
|||||||
}
|
}
|
||||||
entry.Chunks = chunks
|
entry.Chunks = chunks
|
||||||
}
|
}
|
||||||
|
entry.Attributes.Mtime = time.Now().Unix()
|
||||||
entry.Attributes.FileSize = req.Size
|
entry.Attributes.FileSize = req.Size
|
||||||
file.dirtyMetadata = true
|
file.dirtyMetadata = true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user