UPSTREAM: vsock/virtio: set SOCK_DONE on peer shutdown

Set the SOCK_DONE flag to match the TCP_CLOSING state when a peer has
shut down and there is nothing left to read.

This fixes the following bug:
1) Peer sends SHUTDOWN(RDWR).
2) Socket enters TCP_CLOSING but SOCK_DONE is not set.
3) read() returns -ENOTCONN until close() is called, then returns 0.

Signed-off-by: Stephen Barber <smbarber@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry picked from commit 42f5cda5eaf4396a939ae9bb43bb8d1d09c1b15c)
BUG=chromium:848063
TEST=while true; do curl localhost:8080; done

Change-Id: I8e03e006a17afeaee7720747d1771710c45ec58c
Reviewed-on: https://chromium-review.googlesource.com/1696747
Tested-by: Stephen Barber <smbarber@chromium.org>
Commit-Ready: Stephen Barber <smbarber@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
1 file changed