Skip to content

Commit

Permalink
meta/sql: fix nanosecond part in Write (#4618)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyXSD committed Jun 19, 2024
1 parent c42509b commit ef24d00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/meta/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2253,10 +2253,10 @@ func (m *dbMeta) Write(ctx Context, inode Ino, indx uint32, off uint32, slice Sl
return err
}
nodeAttr.Mtime = mtime.UnixNano() / 1e3
nodeAttr.Mtimensec = int16(mtime.Nanosecond())
nodeAttr.Mtimensec = int16(mtime.Nanosecond() % 1e3)
ctime := time.Now()
nodeAttr.Ctime = ctime.UnixNano() / 1e3
nodeAttr.Ctimensec = int16(ctime.Nanosecond())
nodeAttr.Ctimensec = int16(ctime.Nanosecond() % 1e3)

var ck = chunk{Inode: inode, Indx: indx}
ok, err = s.ForUpdate().MustCols("indx").Get(&ck)
Expand Down

0 comments on commit ef24d00

Please sign in to comment.