vsock/virtio: reset connected sockets on device removal

[ Upstream commit 85965487ab ]

When the virtio transport device disappear, we should reset all
connected sockets in order to inform the users.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Stefano Garzarella 2019-02-01 12:42:07 +01:00 committed by Greg Kroah-Hartman
parent 5c9e72bfd0
commit 4c870d3c4b
1 changed files with 3 additions and 0 deletions

View File

@ -541,6 +541,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev)
flush_work(&vsock->event_work);
flush_work(&vsock->send_pkt_work);
/* Reset all connected sockets when the device disappear */
vsock_for_each_connected_socket(virtio_vsock_reset_sock);
vdev->config->reset(vdev);
mutex_lock(&vsock->rx_lock);