From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Garzarella Subject: [PATCH RFC v2 0/2] vsock/virtio: fix issues on device hot-unplug Date: Fri, 4 Jan 2019 15:34:09 +0100 Message-ID: <20190104143411.95519-1-sgarzare@redhat.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: davem@davemloft.net, stefanha@redhat.com To: netdev@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33082 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfADOeQ (ORCPT ); Fri, 4 Jan 2019 09:34:16 -0500 Sender: netdev-owner@vger.kernel.org List-ID: These patches try to handle the hot-unplug of vsock virtio transport device in a proper way. Maybe move the vsock_core_init()/vsock_core_exit() functions in the module_init and module_exit of vsock_virtio_transport module can't be the best way, but the architecture of vsock_core forces us to this approach for now. The vsock_core proto_ops expect a valid pointer to the transport device, so we can't call vsock_core_exit() until there are open sockets. Another (little more complex) approach during the device removal, could be to unregister the AF_VSOCK protocol, then reset all sockets and wait for their destruction. At this point, we can set the transport pointer to NULL. Any suggestions would be helpful. v1 -> v2: - Fixed commit message of patch 1. Stefano Garzarella (2): vsock/virtio: fix kernel panic after device hot-unplug vsock/virtio: reset connected sockets on device removal net/vmw_vsock/virtio_transport.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) -- 2.20.1