diff options
author | Arseniy Krasnov <AVKrasnov@sberdevices.ru> | 2022-08-19 05:29:34 +0000 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-08-23 10:43:11 +0200 |
commit | e7a3266c9167fe8878c303959a8cc4527f83888b (patch) | |
tree | 3edd49d4777544dc0eeea57f928d8092506e3fa1 | |
parent | 24764f8d3c316a3c58b51140d8e489e98e7ffdcc (diff) |
virtio/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>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r-- | net/vmw_vsock/virtio_transport_common.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index ec2c2afbf0d0..8f6356ebcdd1 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -634,10 +634,7 @@ virtio_transport_notify_poll_in(struct vsock_sock *vsk, size_t target, bool *data_ready_now) { - if (vsock_stream_has_data(vsk)) - *data_ready_now = true; - else - *data_ready_now = false; + *data_ready_now = vsock_stream_has_data(vsk) >= target; return 0; } |