Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vsock: Set socket state back to SS_UNCONNECTED in vsock_connect_timeo…
…ut() Imagine two non-blocking vsock_connect() requests on the same socket. The first request schedules @connect_work, and after it times out, vsock_connect_timeout() sets *sock* state back to TCP_CLOSE, but keeps *socket* state as SS_CONNECTING. Later, the second request returns -EALREADY, meaning the socket "already has a pending connection in progress", even though the first request has already timed out. As suggested by Stefano, fix it by setting *socket* state back to SS_UNCONNECTED, so that the second request will return -ETIMEDOUT. Suggested-by: Stefano Garzarella <[email protected]> Fixes: d021c34 ("VSOCK: Introduce VM Sockets") Reviewed-by: Stefano Garzarella <[email protected]> Signed-off-by: Peilin Ye <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information