[RFC PATCH v2 06/15] vsock: check error queue to set EPOLLERR

From: Arseniy Krasnov
Date: Sun Apr 23 2023 - 15:32:16 EST


If socket's error queue is not empty, EPOLLERR must be set.

Signed-off-by: Arseniy Krasnov <AVKrasnov@xxxxxxxxxxxxxx>
---
net/vmw_vsock/af_vsock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 413407bb646c..137a0db6eaac 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1030,8 +1030,8 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
poll_wait(file, sk_sleep(sk), wait);
mask = 0;

- if (sk->sk_err)
- /* Signify that there has been an error on this socket. */
+ /* Signify that there has been an error on this socket. */
+ if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue))
mask |= EPOLLERR;

/* INET sockets treat local write shutdown and peer write shutdown as a
--
2.25.1