Generate notification when closing host fd.

Thanks ianlewis@ for discovering the bug/fix!

PiperOrigin-RevId: 368740744
This commit is contained in:
Dean Deng
2021-04-15 16:30:58 -07:00
committed by gVisor bot
parent 10de8978f9
commit b5919d3065
+3
View File
@@ -460,6 +460,9 @@ func (i *inode) DecRef(ctx context.Context) {
if err := unix.Close(i.hostFD); err != nil {
log.Warningf("failed to close host fd %d: %v", i.hostFD, err)
}
// We can't rely on fdnotifier when closing the fd, because the event may race
// with fdnotifier.RemoveFD. Instead, notify the queue explicitly.
i.queue.Notify(waiter.EventHUp | waiter.ReadableEvents | waiter.WritableEvents)
})
}