aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/vmw_vsock/vmci_transport_notify.c
diff options
context:
space:
mode:
authorArseniy Krasnov <AVKrasnov@sberdevices.ru>2022-08-19 05:31:43 +0000
committerPaolo Abeni <pabeni@redhat.com>2022-08-23 10:43:11 +0200
commita274f6ff3c5c79c27d254b48cad3b4814c950908 (patch)
tree7747e3459a95153ff4941eb5b16d28887187155e /net/vmw_vsock/vmci_transport_notify.c
parentvirtio/vsock: use 'target' in notify_poll_in callback (diff)
downloadwireguard-linux-a274f6ff3c5c79c27d254b48cad3b4814c950908.tar.xz
wireguard-linux-a274f6ff3c5c79c27d254b48cad3b4814c950908.zip
vmci/vsock: use 'target' in notify_poll_in callback
This callback controls setting of POLLIN, POLLRDNORM output bits of poll() syscall, but in some cases, it is incorrectly to set it, when socket has at least 1 bytes of available data. Use 'target' which is already exists. Signed-off-by: Arseniy Krasnov <AVKrasnov@sberdevices.ru> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Vishnu Dasa <vdasa@vmware.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/vmw_vsock/vmci_transport_notify.c')
-rw-r--r--net/vmw_vsock/vmci_transport_notify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
index d69fc4b595ad..852097e2b9e6 100644
--- a/net/vmw_vsock/vmci_transport_notify.c
+++ b/net/vmw_vsock/vmci_transport_notify.c
@@ -340,12 +340,12 @@ vmci_transport_notify_pkt_poll_in(struct sock *sk,
{
struct vsock_sock *vsk = vsock_sk(sk);
- if (vsock_stream_has_data(vsk)) {
+ if (vsock_stream_has_data(vsk) >= target) {
*data_ready_now = true;
} else {
- /* We can't read right now because there is nothing in the
- * queue. Ask for notifications when there is something to
- * read.
+ /* We can't read right now because there is not enough data
+ * in the queue. Ask for notifications when there is something
+ * to read.
*/
if (sk->sk_state == TCP_ESTABLISHED) {
if (!send_waiting_read(sk, 1))