← Prev in month ← Prev in thread
Next in thread → Next in month →

[RFC v4 5/6] virtio/vhost-vsock: Avoid lockdep warning

From
Claudio Imbrenda <>
Date
2016-03-31T11:41:46+00:00
ID
Thread
[RFC v4 5/6] virtio/vhost-vsock: Avoid lockdep warning
release the lock on the child socket before calling
virtio_transport_send_response . Thid avoids complaints from lockdep, but
I'm not sure it won't introduce race conditions.
This patch should be considered more as a hint, unless someone more
knowledgeable can confirm that it won't create problems.

Signed-off-by: Claudio Imbrenda <>
---
 net/vmw_vsock/virtio_transport_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index 6698b61..ca42fa9 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -804,9 +804,10 @@ virtio_transport_recv_listen(struct sock *sk, struct virtio_vsock_pkt *pkt)
 
 	vsock_insert_connected(vchild);
 	vsock_enqueue_accept(sk, child);
+	release_sock(child);
+
 	virtio_transport_send_response(vchild, pkt);
 
-	release_sock(child);
 
 	sk->sk_data_ready(sk);
 	return 0;
-- 
1.9.1
← Prev in month ← Prev in thread
Next in thread → Next in month →