mount: keep a link change's ctime in the dirty entry

The flush does not restamp times, so a dirty entry carrying an earlier
write's ctime moved the filer's ctime back from the link or unlink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-13 01:46:13 -08:00
1 parent abe03ccbd3
commit b6dfb75cc9
1 file changed
+3
+3
View File
@@ -255,6 +255,9 @@ func (fh *FileHandle) adoptLinkChangeLocked(stored *filer_pb.Entry, versionTsNs
fh.UpdateEntry(func(entry *filer_pb.Entry) {
entry.Name = linked.Name
entry.HardLinkId, entry.HardLinkCounter = linked.HardLinkId, linked.HardLinkCounter
if a, b := entry.Attributes, linked.Attributes; a != nil && b != nil && (b.Ctime > a.Ctime || b.Ctime == a.Ctime && b.CtimeNs > a.CtimeNs) {
a.Ctime, a.CtimeNs = b.Ctime, b.CtimeNs
}
})
} else {
fh.SetEntry(proto.Clone(linked).(*filer_pb.Entry))