Repository navigation
fix(lock): retain exact bigint identities for cleanup - #719
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 27, 2026, 12:58 AM ET / 04:58 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch captures bigint file identities for sidecar lock cleanup and FileStore pruning, adds collision regressions, and documents rejection of unsafe legacy receipts. Merge readiness⛔ Blocked before merge - 4 items remain Keep open. Current main and v0.21.0 still have the lossy lock cleanup path, and this PR is a distinct safety repair. The mixed-version cleanup effect and release timing need a maintainer decision. Priority: P2 Review scores
Verification
How this fits togetherfs-safe uses sidecar files to coordinate exclusive access to protected files, then checks ownership evidence before removing them. FileStore pruning checks directory identity before acting on a listing of expired entries. flowchart LR
A[Lock request] --> B[Sidecar file]
B --> C[Exact identity snapshot]
C --> D{Identity still matches?}
D -->|Yes| E[Guarded removal]
D -->|No| F[Preserve changed file]
G[Store directory listing] --> H[Directory identity check]
H --> D
Decision needed
Why: The PR explicitly leaves release timing open, and a lock retained from an older in-process receipt is an intentional upgrade effect that needs release-owner acceptance. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep exact identities through cleanup, fail closed on rounded legacy receipts, and document safe recovery for a retained lock. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows numeric cleanup observations, and the new tests define a precise collision and replacement scenario; this read-only review did not execute the baseline. Is this the best way to solve the issue? Yes. Exact bigint observations and fail-closed comparison address the rounding hazard at its source; mixed-version cleanup still needs release guidance. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against eac699e65bef. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Failed raw sidecar acquisition could retain rounded numeric device/inode IDs and later treat a different file as its own during no-token cleanup. Capture bigint stats throughout async/sync acquisition, snapshot matching, Root snapshot capture, and exit cleanup. Reject unsafe numeric IDs in the shared cleanup comparator so older in-process receipts cannot authorize deletion. Token ownership and unknown-Windows-identity safeguards remain intact.
Synthetic regressions use distinct IDs above 2^53 that round to the same JavaScript number. They prove that failed async/sync acquisition preserves the successor, closes both descriptors, and retains the original error, for both device and inode collisions. All six collision tests fail against the baseline and pass with the fix. Additional large-ID Root stale-reclaim tests prove that unchanged locks remain reclaimable.
The requested
sameFileIdentityForCleanup/.inoaudit also found numeric directory comparisons in file-store pruning; those observations now use bigint, with a regression preserving a directory changed during listing. Expiry-only metadata stays numeric where fractional milliseconds matter. Other cleanup/deletion families already obtain bigint stats: creation, publication, temporary files/workspaces, moves, native operations, queues, Root removal, and case/suffix probes. Remaining numeric fast paths in Root removal and temporary-workspace/stat admission validate safe integers against exact identities or obtain bigint observations; directory receipts retain private exact provenance, and numeric public metadata is not deletion authority. Unsafe legacy inputs additionally fail closed in the shared comparator.Validation at
3e99f29953f621f29ed8ed0175bc2741db39b823:The first CI run caught two follow-ups addressed here: native creation bypassed the raw test's injected
fs.openfailure, and synchronous Root disk snapshots still supplied numeric stats to comparison on large-ID Windows filesystems. The fixture now explicitly selects the raw implementation; Root snapshots now retain bigint metadata too. A legacy success fixture uses exact stats, consistent with the new rejection of unsafe numeric receipts.No changelog edits. Leave unmerged for the 0.21.1 decision.