summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-10-11 09:49:31 -0700
committergVisor bot <gvisor-bot@google.com>2021-10-11 09:49:31 -0700
commit09a42f9976403e6842a291b49ac2ab3319a5d02e (patch)
tree97cff01b25f1802e845b5a64e3a73e01ebfb987a /pkg/sentry/vfs
parent3f1642e4bc86c6e7febc6b2dd2b83ad48c5ee201 (diff)
parent57da3c7ddd50f9a909d9b0022fe63eb201a2ca0e (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.go6
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