summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2019-02-01 12:42:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-13 14:05:00 -0700
commit4c870d3c4b3464503a713770bbd6fefde1f49e26 (patch)
tree5f4c412b0b7f8ae06262d09f081e52cb43287662 /net
parent5c9e72bfd09a53ea1b5b71fc5b84e09bacc9a975 (diff)
vsock/virtio: reset connected sockets on device removal
[ Upstream commit 85965487abc540368393a15491e6e7fcd230039d ] 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>
Diffstat (limited to 'net')
-rw-r--r--net/vmw_vsock/virtio_transport.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 6cbc08d82e7f..f66a6010ae07 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -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);