Commit ee0b3843 authored by Arseniy Krasnov's avatar Arseniy Krasnov Committed by Paolo Abeni

vsock: pass sock_rcvlowat to notify_poll_in as target

Passing 1 as the target to notify_poll_in(), we don't honor
what the user has set via SO_RCVLOWAT, going to set POLLIN
and POLLRDNORM, even if we don't have the amount of bytes
expected by the user.

Let's use sock_rcvlowat() to get the right target to pass to
notify_poll_in();
Signed-off-by: default avatarArseniy Krasnov <AVKrasnov@sberdevices.ru>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent a274f6ff
...@@ -1066,8 +1066,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, ...@@ -1066,8 +1066,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
if (transport && transport->stream_is_active(vsk) && if (transport && transport->stream_is_active(vsk) &&
!(sk->sk_shutdown & RCV_SHUTDOWN)) { !(sk->sk_shutdown & RCV_SHUTDOWN)) {
bool data_ready_now = false; bool data_ready_now = false;
int target = sock_rcvlowat(sk, 0, INT_MAX);
int ret = transport->notify_poll_in( int ret = transport->notify_poll_in(
vsk, 1, &data_ready_now); vsk, target, &data_ready_now);
if (ret < 0) { if (ret < 0) {
mask |= EPOLLERR; mask |= EPOLLERR;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment