Skip to content

Commit

Permalink
VSOCK: call sk->sk_data_ready() on accept()
Browse files Browse the repository at this point in the history
When a listen socket enqueues a connection for userspace to accept(),
the sk->sk_data_ready() callback should be invoked.  In-kernel socket
users rely on this callback to detect when incoming connections are
available.

Currently the sk->sk_state_change() callback is invoked by
vmci_transport.c.  This happens to work for userspace applications since
sk->sk_state_change = sock_def_wakeup() and sk->sk_data_ready =
sock_def_readable() both wake up the accept() waiter.  In-kernel socket
users, on the other hand, fail to detect incoming connections.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
stefanhaRH authored and davem330 committed Nov 5, 2015
1 parent f63ce5b commit 7362945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/vmw_vsock/vmci_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ vmci_transport_recv_connecting_server(struct sock *listener,
/* Callers of accept() will be be waiting on the listening socket, not
* the pending socket.
*/
listener->sk_state_change(listener);
listener->sk_data_ready(listener);

return 0;

Expand Down

0 comments on commit 7362945

Please sign in to comment.