Skip to content

Commit da5a856

Browse files
committed
docs(uffd): fix prefault comment about EEXIST return path
The comment in Prefault claimed faultPage returns EEXIST and "handled stays false" when a concurrent on-demand fault beats us. faultPage actually treats EEXIST as handled (returns true, nil), so handled is true and we still call setState(faulted) + prefetchTracker.Add(...). The comment now reflects the real semantics. No behavior change. Addresses PR #2520 review thread (Cursor Bugbot comment id 3177646485).
1 parent 08e94de commit da5a856

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • packages/orchestrator/pkg/sandbox/uffd/userfaultfd

packages/orchestrator/pkg/sandbox/uffd/userfaultfd/prefault.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ func (u *Userfaultfd) Prefault(ctx context.Context, offset int64, data []byte) e
3030
return nil
3131
}
3232

33-
// Prefault as a read so the page gets WP set. If a concurrent on-demand
34-
// write fault beats us, faultPage returns EEXIST and handled stays false.
33+
// Prefault as a read so the page gets WP set. faultPage treats EEXIST
34+
// as handled (returns true,nil), so a concurrent on-demand fault that
35+
// installs the page first is silently absorbed; handled stays false
36+
// only when faultPage soft-failed (e.g. UFFDIO_COPY EAGAIN).
3537
handled, err := u.faultPage(
3638
ctx,
3739
addr,

0 commit comments

Comments
 (0)