summaryrefslogtreecommitdiffstats
path: root/net/vmw_vsock
diff options
context:
space:
mode:
authorArseniy Krasnov <AVKrasnov@sberdevices.ru>2022-08-19 05:33:47 +0000
committerPaolo Abeni <pabeni@redhat.com>2022-08-23 10:43:11 +0200
commitee0b3843a26920dad713c27cd8f3a3cfc5ae9c37 (patch)
tree6ef8da6f9821477b7c9a004cdb62821286c9e204 /net/vmw_vsock
parenta274f6ff3c5c79c27d254b48cad3b4814c950908 (diff)
downloadlinux-stable-ee0b3843a26920dad713c27cd8f3a3cfc5ae9c37.tar.gz
linux-stable-ee0b3843a26920dad713c27cd8f3a3cfc5ae9c37.tar.bz2
linux-stable-ee0b3843a26920dad713c27cd8f3a3cfc5ae9c37.zip
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: Arseniy Krasnov <AVKrasnov@sberdevices.ru> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/vmw_vsock')
-rw-r--r--net/vmw_vsock/af_vsock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 07c8f74a821f..15171ba76cc3 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1066,8 +1066,9 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
if (transport && transport->stream_is_active(vsk) &&
!(sk->sk_shutdown & RCV_SHUTDOWN)) {
bool data_ready_now = false;
+ int target = sock_rcvlowat(sk, 0, INT_MAX);
int ret = transport->notify_poll_in(
- vsk, 1, &data_ready_now);
+ vsk, target, &data_ready_now);
if (ret < 0) {
mask |= EPOLLERR;
} else {