We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5896b7b commit d725d87Copy full SHA for d725d87
1 file changed
packages/orchestrator/pkg/sandbox/uffd/userfaultfd/userfaultfd.go
@@ -555,9 +555,10 @@ func (u *Userfaultfd) faultPage(
555
}
556
557
func (u *Userfaultfd) PrefetchData() block.PrefetchData {
558
- // This will be at worst cancelled when the uffd is closed.
+ // Hold Lock across the read — Lock; Unlock; Read leaves a window
559
+ // where a worker can RLock and mutate prefetchTracker before we read.
560
u.settleRequests.Lock()
- u.settleRequests.Unlock() //nolint:staticcheck // SA2001: intentional — we just need to settle the read locks.
561
+ defer u.settleRequests.Unlock()
562
563
return u.prefetchTracker.PrefetchData()
564
0 commit comments