RE: [PATCH net-next 13/14] vsock: prevent transport modules unloading
From: Jorgen Hansen
Date: Mon Nov 11 2019 - 11:36:30 EST
> From: Stefano Garzarella [mailto:sgarzare@xxxxxxxxxx]
> Sent: Wednesday, October 23, 2019 11:56 AM
> This patch adds 'module' member in the 'struct vsock_transport'
> in order to get/put the transport module. This prevents the
> module unloading while sockets are assigned to it.
>
> We increase the module refcnt when a socket is assigned to a
> transport, and we decrease the module refcnt when the socket
> is destructed.
>
> Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
> Signed-off-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
> ---
> RFC -> v1:
> - fixed typo 's/tranport/transport/' in a comment (Stefan)
> ---
> drivers/vhost/vsock.c | 2 ++
> include/net/af_vsock.h | 2 ++
> net/vmw_vsock/af_vsock.c | 20 ++++++++++++++++----
> net/vmw_vsock/hyperv_transport.c | 2 ++
> net/vmw_vsock/virtio_transport.c | 2 ++
> net/vmw_vsock/vmci_transport.c | 1 +
> 6 files changed, 25 insertions(+), 4 deletions(-)
Reviewed-by: Jorgen Hansen <jhansen@xxxxxxxxxx>