]> git.baikalelectronics.ru Git - kernel.git/commit
VSOCK: set POLLOUT | POLLWRNORM for TCP_CLOSING
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 26 Jan 2018 11:48:25 +0000 (11:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Jan 2018 16:16:27 +0000 (11:16 -0500)
commita9958f633f14525c9ea2df6772d32a19835b0cc7
tree582b734fdf0dd5098a5cd57021e69e484595328f
parent78306642dc7960bf17cc5788df8b9be0f0588d71
VSOCK: set POLLOUT | POLLWRNORM for TCP_CLOSING

select(2) with wfds but no rfds must return when the socket is shut down
by the peer.  This way userspace notices socket activity and gets -EPIPE
from the next write(2).

Currently select(2) does not return for virtio-vsock when a SEND+RCV
shutdown packet is received.  This is because vsock_poll() only sets
POLLOUT | POLLWRNORM for TCP_CLOSE, not the TCP_CLOSING state that the
socket is in when the shutdown is received.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/af_vsock.c