Commit 2d6df29
fix: Address race condition in generation handling after sealDir
Move the generation load to immediately after sealDir() returns but
before reacquiring dh.mu. This ensures we capture the generation at
the point when sealDir completes, avoiding a race where another thread
could call sealDir() between our unlock and the generation load.
The sequence is now:
1. Unlock dh.mu
2. Call sealDir()
3. Load generation (while dh.mu is still unlocked)
4. Reacquire dh.mu
5. Update dh.generation
This ensures we get the most accurate generation value while still
avoiding the deadlock.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent fa72b28 commit 2d6df29
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
| 640 | + | |
639 | 641 | | |
640 | 642 | | |
641 | | - | |
| 643 | + | |
642 | 644 | | |
643 | 645 | | |
644 | 646 | | |
| |||
0 commit comments