File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/orchestrator/internal/sandbox/uffd/userfaultfd Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -279,8 +279,9 @@ func (u *Userfaultfd) Unregister() error {
279279func (u * Userfaultfd ) Dirty () * block.Tracker {
280280 // This will be at worst cancelled when the uffd is closed.
281281 u .settleRequests .Lock ()
282- // Intentionally not using defer—we just need to write lock and write unlock the mutex, to be sure all the RLock calls are released.
283- u .settleRequests .Unlock () //nolint:staticcheck
282+ // The locking here would work even without using defer (just lock-then-unlock the mutex), but at this point let's make it lock to the clone,
283+ // so it is consistent even if there is a another uffd call after.
284+ defer u .settleRequests .Unlock ()
284285
285286 return u .missingRequests .Clone ()
286287}
You can’t perform that action at this time.
0 commit comments