Skip to content

Commit

Permalink
vsock: absorb spurious EPOLLOUT events
Browse files Browse the repository at this point in the history
This commit changes the vsock connection state machine behavior to absorb
any EWOULDBLOCK errors recevied while handling an EPOLLOUT event. Previously,
this condition would lead to immediate connection termination.

Signed-off-by: Dan Horobeanu <[email protected]>
Signed-off-by: Gabriel Ionescu <[email protected]>
  • Loading branch information
dhrgit authored and lauralt committed Jun 12, 2020
1 parent 660d18c commit 109e631
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/devices/src/virtio/vsock/csm/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,13 @@ where
"vsock: error flushing TX buf for (lp={}, pp={}): {:?}",
self.local_port, self.peer_port, err
);
self.kill();
match err {
Error::TxBufFlush(inner) if inner.kind() == ErrorKind::WouldBlock => {
// This should never happen (EWOULDBLOCK after EPOLLOUT), but
// it does, so let's absorb it.
}
_ => self.kill(),
};
0
});
self.fwd_cnt += Wrapping(flushed as u32);
Expand Down

0 comments on commit 109e631

Please sign in to comment.