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 authored Apr 1, 2024
1 parent 755cf41 commit c4ff9a1
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 @@ -2357,10 +2357,10 @@ func (m *dbMeta) doWrite(ctx Context, inode Ino, indx uint32, off uint32, slice
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)
m.parseAttr(&nodeAttr, attr)

buf := marshalSlice(off, slice.Id, slice.Size, slice.Off, slice.Len)
Expand Down

0 comments on commit c4ff9a1

Please sign in to comment.