diff --git a/backend/hdfs/object.go b/backend/hdfs/object.go index d6d25297f..688e663ea 100644 --- a/backend/hdfs/object.go +++ b/backend/hdfs/object.go @@ -50,7 +50,10 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error { if err != nil { return err } - o.modTime = modTime + // Chtimes sets the modtime with second precision so truncate + // here too to keep the in-memory modtime identical to the one a + // fresh listing returns. + o.modTime = modTime.Truncate(time.Second) return nil }