From patchwork Fri Aug 19 05:29:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 12948328 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC4B5C32771 for ; Fri, 19 Aug 2022 05:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346313AbiHSFaE (ORCPT ); Fri, 19 Aug 2022 01:30:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345200AbiHSFaD (ORCPT ); Fri, 19 Aug 2022 01:30:03 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648CDD573F; Thu, 18 Aug 2022 22:30:02 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 98D675FD07; Fri, 19 Aug 2022 08:30:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1660887000; bh=HkUmGO8BR4mvsCDioUDHVxe6cFrtTj9VNblWxBkjvUY=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ToD49HiAHMATFc3HmtcrWHGzvOO3K5HC/19fw+fGQxKWZDKEGEINyJtdSPh5Ca5OJ 8ncHFb8oWaMqKVWN/9Hs1X4sha4RtNOv33MpwhqZz7xGqIKldijd2FYUPlDxkNsJ3A /Cl9EaQg+psPqazAuT/xpZNDZh2JhUFeLj8MmTXSyI2wY/OVmAF5ilCacuFVWxlO8a yOov7nXCnUxg5zjqqOU9A2sKvWWOHUDKT5b4heSqR8ZU23CXzZGEKaNdCo9840ot1Q HhMyt9BTvm+WBlnOhqw1LQQx9aLC9uoChP1JwcLPNtGb17lF/blynP79raqI34lT+m s2Ep/1Fb3cdXA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mail.sberdevices.ru (Postfix) with ESMTP; Fri, 19 Aug 2022 08:29:59 +0300 (MSK) From: Arseniy Krasnov To: Stefano Garzarella , "David S. Miller" , "edumazet@google.com" , "Jakub Kicinski" , Paolo Abeni , "kys@microsoft.com" , "haiyangz@microsoft.com" , "sthemmin@microsoft.com" , "wei.liu@kernel.org" , Dexuan Cui , Stefan Hajnoczi , Bryan Tan , Vishnu Dasa , Krasnov Arseniy , "Michael S. Tsirkin" CC: "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , kernel , VMware PV-Drivers Reviewers Subject: [PATCH net-next v4 3/9] virtio/vsock: use 'target' in notify_poll_in callback Thread-Topic: [PATCH net-next v4 3/9] virtio/vsock: use 'target' in notify_poll_in callback Thread-Index: AQHYs4yqyCPs/xU05EWXDbxbWPV2ow== Date: Fri, 19 Aug 2022 05:29:34 +0000 Message-ID: <61ef8a18-24fe-d16c-b093-764d3b66804a@sberdevices.ru> In-Reply-To: Accept-Language: en-US, ru-RU Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-ID: <8ECC2C8816C4704D8DC273A24207C7C9@sberdevices.ru> MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/19 00:26:00 #20118704 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport_common.c | 5 +---- 1 file changed, 1 insertion(+), 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; }