vsock/vmci: Fix lockdep warnings
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.
Signed-off-by Ian Forbes <[email protected]>
--- net/vmw_vsock/vmci_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -1
@@ -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
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.
Signed-off-by Ian Forbes <[email protected]>--- net/vmw_vsock/vmci_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)net/vmw_vsock/vmci_transport.c +1
-2@@ -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
Acked-by Bryan Tan <[email protected]>