Thread (8 messages) 8 messages, 3 authors, 2025-02-13

Re: [PATCH 2/2] vsock/virtio: Don't reset the created SOCKET during s2r

From: <hidden>
Date: 2025-02-10 11:48:10
Also in: kvm, virtualization

Possibly related (same subject, not in this thread)

Like for the other patch, some maintainers have not been CCd.

On Fri, Feb 07, 2025 at 01:20:33PM +0800, Junnan Wu wrote:
From: Ying Gao <redacted>

If suspend is executed during vsock communication and the
socket is reset, the original socket will be unusable after resume.

Judge the value of vdev->priv in function virtio_vsock_vqs_del,
only when the function is invoked by virtio_vsock_remove,
all vsock connections will be reset.
The second part of the commit message is not that clear, do you mind 
rephrasing it?
Signed-off-by: Ying Gao <redacted>
Missing Co-developed-by?
Signed-off-by: Junnan Wu <redacted>
quoted hunk ↗ jump to hunk
---
net/vmw_vsock/virtio_transport.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
index 9eefd0fba92b..9df609581755 100644
--- a/net/vmw_vsock/virtio_transport.c
+++ b/net/vmw_vsock/virtio_transport.c
@@ -717,8 +717,10 @@ static void virtio_vsock_vqs_del(struct virtio_vsock *vsock)
	struct sk_buff *skb;

	/* Reset all connected sockets when the VQs disappear */
-	vsock_for_each_connected_socket(&virtio_transport.transport,
-					virtio_vsock_reset_sock);
I would add a comment explaining why you are adding this check.
+	if (!vdev->priv) {
+		vsock_for_each_connected_socket(&virtio_transport.transport,
+						virtio_vsock_reset_sock);
+	}

	/* Stop all work handlers to make sure no one is accessing the device,
	 * so we can safely call virtio_reset_device().
-- 
2.34.1
I am not familiar with freeze/resume, but I don't see any problems with 
this patch.

Thank you,
Luigi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help