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

[RFC v3 5/7] Vhost-vsock: Use nested lock notation

From
Claudio Imbrenda <>
Date
2016-03-11T15:46:02+00:00
ID
Thread
[RFC v3 5/7] Vhost-vsock: Use nested lock notation
From: Claudio Imbrenda <>

Since the socket was created locally and wasn't passed around, nobody can
have a reference to it yet, so locking it shouldn't block, therefore no
deadlock should be possible.
I'm not sure why, if at all, it is needed to lock the child socket there,
but this patch makes sure that lockdep is happy, and hopefully it doesn't
mask an actual deadlock.

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

diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c
index fa54359..6698b61 100644
--- a/net/vmw_vsock/virtio_transport_common.c
+++ b/net/vmw_vsock/virtio_transport_common.c
@@ -792,7 +792,7 @@ virtio_transport_recv_listen(struct sock *sk, struct virtio_vsock_pkt *pkt)
 
 	sk->sk_ack_backlog++;
 
-	lock_sock(child);
+	lock_sock_nested(child, SINGLE_DEPTH_NESTING);
 
 	child->sk_state = SS_CONNECTED;
 
-- 
1.9.1
← Prev in month ← Prev in thread
Next in thread → Next in month →