OSDN Git Service

UPSTREAM: vsock: make listener child lock ordering explicit
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 23 Jun 2016 15:28:58 +0000 (16:28 +0100)
committerAlistair Strachan <astrachan@google.com>
Wed, 16 Jan 2019 01:08:34 +0000 (17:08 -0800)
commita598d93c2a3ab180d9a52ad15fcf023a1ee897d8
treec5beac3a22a04fb1aebf176fbe1ec89d67a12df3
parent0f0ec3accb21ac2f7e510c44326294bd4164fc19
UPSTREAM: vsock: make listener child lock ordering explicit

There are several places where the listener and pending or accept queue
child sockets are accessed at the same time.  Lockdep is unhappy that
two locks from the same class are held.

Tell lockdep that it is safe and document the lock ordering.

Originally Claudio Imbrenda <imbrenda@linux.vnet.ibm.com> sent a similar
patch asking whether this is safe.  I have audited the code and also
covered the vsock_pending_work() function.

Suggested-by: Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4192f672fae559f32d82de72a677701853cc98a7)
Bug: 121166534
Test: Ran cuttlefish with android-4.4 + VSOCKETS, VMWARE_VMCI_VSOCKETS
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Change-Id: I0cb7ee964057e9338971e1a2043ae17557feaec7
net/vmw_vsock/af_vsock.c