You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not unlink a reused atomic JSON temporary name #485
Cleanup may unlink a temporary basename only while the directory entry still
identifies the inode opened by this writer.
Observed
If the temporary entry is removed and an unrelated file reuses its basename
before inode validation, validation raises but the caller retains the basename.
The finally block then unlinks the unrelated replacement.
Acceptance
Record the opened temporary inode identity.
Treat missing or mismatched validation entries as lost ownership.
Before failure cleanup, verify the current entry still matches the opened
identity.
Preserve an unrelated same-name replacement in a deterministic regression.
Activity
fix: bind temp cleanup to opened inode (#485)
test: cover post-publication replacement error (#485)
fix: retain failed atomic temps safely (#485)
Anionix commentedon Jul 24, 2026
Resolved at
84ddd0d11fd5a39d56d84b50ed24c56b9b9961adby removing thenon-portable guarantee instead of adding another check:
statandunlinkoperations, so an inodecomparison cannot make name-based deletion atomic.
unlinkat all.0600before payload bytes are written.after the complete payload is flushed, immediately before replacement.
retains the temp.
os.unlinkto fail if any name-based failure cleanup isattempted.
This closes both synchronized-thread and injected-wrapper reproductions without
claiming a kernel primitive that does not exist.