diff options
author | Stefano Garzarella <sgarzare@redhat.com> | 2019-02-01 12:42:07 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-03 20:06:25 +0100 |
commit | 85965487abc540368393a15491e6e7fcd230039d (patch) | |
tree | e06307c9f6e757d2263f5a4584054a8f7b338fda /net | |
parent | vsock/virtio: fix kernel panic after device hot-unplug (diff) | |
download | linux-85965487abc540368393a15491e6e7fcd230039d.tar.xz linux-85965487abc540368393a15491e6e7fcd230039d.zip |
vsock/virtio: reset connected sockets on device removal
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/vmw_vsock/virtio_transport.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 9dae54698737..15eb5d3d4750 100644 --- a/net/vmw_vsock/virtio_transport.c +++ b/net/vmw_vsock/virtio_transport.c @@ -634,6 +634,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); |