diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-10-11 09:49:31 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-10-11 09:49:31 -0700 |
commit | 09a42f9976403e6842a291b49ac2ab3319a5d02e (patch) | |
tree | 97cff01b25f1802e845b5a64e3a73e01ebfb987a /pkg/sentry/vfs | |
parent | 3f1642e4bc86c6e7febc6b2dd2b83ad48c5ee201 (diff) | |
parent | 57da3c7ddd50f9a909d9b0022fe63eb201a2ca0e (diff) |
Merge pull request #6428 from dillanzhou:fix_epoll_vfs2
PiperOrigin-RevId: 402323053
Diffstat (limited to 'pkg/sentry/vfs')
-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 |