Skip to contentSkip to conversation

VSOCK: call sk->sk_data_ready() on accept()

PATCH Applied Stefan Hajnoczi 2 participants 2 messages Nov 4, 2015 – Nov 5, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VSOCK: call sk->sk_data_ready() on accept()

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.

---
 net/vmw_vsock/vmci_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/vmw_vsock/vmci_transport.c +1 -1
index 7555cad..9363abb 100644
@@ -1236,7 +1236,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;
 
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw

From: Stefan Hajnoczi <[email protected]>
Date: Wed, 4 Nov 2015 12:58:42 +0000

Quoted 5 lines

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.

Quoted 7 lines

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.

Applied.