diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-11 16:54:25 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-11 16:54:25 +0000 |
commit | ae06e10bf846ce10b1ebe7bb3c4fe741e3421e17 (patch) | |
tree | 5094085a43bb625e56ed37c7ea4b61d5a8cecbbb /pkg/sentry | |
parent | 9cafd368f18ab756221d2007183a46abe9a56a85 (diff) | |
parent | 09a42f9976403e6842a291b49ac2ab3319a5d02e (diff) |
Merge release-20210927.0-55-g09a42f997 (automated)
Diffstat (limited to 'pkg/sentry')
-rw-r--r-- | pkg/sentry/vfs/epoll.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/sentry/vfs/epoll.go b/pkg/sentry/vfs/epoll.go index 04bc4d10c..fefd0fc9c 100644 --- a/pkg/sentry/vfs/epoll.go +++ b/pkg/sentry/vfs/epoll.go @@ -135,12 +135,16 @@ func (ep *EpollInstance) Readiness(mask waiter.EventMask) waiter.EventMask { return 0 } ep.mu.Lock() - for epi := ep.ready.Front(); epi != nil; epi = epi.Next() { + var next *epollInterest + for epi := ep.ready.Front(); epi != nil; epi = next { + next = epi.Next() wmask := waiter.EventMaskFromLinux(epi.mask) if epi.key.file.Readiness(wmask)&wmask != 0 { ep.mu.Unlock() return waiter.ReadableEvents } + ep.ready.Remove(epi) + epi.ready = false } ep.mu.Unlock() return 0 |