mount: don't set modtime twice #2021

This commit is contained in:
Nick Craig-Wood 2018-01-29 20:49:13 +00:00
parent 1852a0e0c9
commit c277a4096c

View File

@ -46,11 +46,10 @@ var _ fusefs.NodeSetattrer = (*File)(nil)
func (f *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error) {
defer log.Trace(f, "a=%+v", req)("err=%v", &err)
if !f.VFS().Opt.NoModTime {
if req.Valid.MtimeNow() {
err = f.File.SetModTime(time.Now())
}
if req.Valid.Mtime() {
err = f.File.SetModTime(req.Mtime)
} else if req.Valid.MtimeNow() {
err = f.File.SetModTime(time.Now())
}
}
if req.Valid.Size() {