Skip to contentSkip to conversation

vsock/vmci: Fix lockdep warnings

PATCH In review Ian Forbes 2 participants 2 messages Mar 13 – Apr 10

Subsystems (3)
lore
Share & tools
lore

Ian Forbes

author
#0 lore raw

PATCH 1/1 vsock/vmci: Fix lockdep warnings

We are taking the same class of lock when accepting a new socket while holding the lock for the accepting socket itself. This pattern can be found in many other net drivers so just copy what they are doing.

---
 net/vmw_vsock/vmci_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -1
index 4296ca1183f1..3176cc8af2c7 100644
@@ -964,7 +964,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
 	 */
 	pending = vmci_transport_get_pending(sk, pkt);
 	if (pending) {
-		lock_sock(pending);
+		lock_sock_nested(pending, SINGLE_DEPTH_NESTING);
 
 		/* The local context ID may be out of date. */
 		vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context;
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 24 lines · Ian Forbes

We are taking the same class of lock when accepting a new socket while holding the lock for the accepting socket itself. This pattern can be found in many other net drivers so just copy what they are doing.

---
 net/vmw_vsock/vmci_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -2
index 4296ca1183f1..3176cc8af2c7 100644
@@ -964,7 +964,7 @@ static int vmci_transport_recv_listen(struct sock *sk,
         */
        pending = vmci_transport_get_pending(sk, pkt);
        if (pending) {
-               lock_sock(pending);
+               lock_sock_nested(pending, SINGLE_DEPTH_NESTING);
 
                /* The local context ID may be out of date. */
                vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context;
--
Quoted 2 lines

2.53.0