From patchwork Mon Feb 6 06:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 13129362 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 86A2AC05027 for ; Mon, 6 Feb 2023 06:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229802AbjBFGxd (ORCPT ); Mon, 6 Feb 2023 01:53:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229796AbjBFGxa (ORCPT ); Mon, 6 Feb 2023 01:53:30 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6CAD125AF; Sun, 5 Feb 2023 22:53:24 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 0C29E5FD03; Mon, 6 Feb 2023 09:53:23 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1675666403; bh=b+WXxyeJ81HGb6IFMi06G8yU3v92PAG7EK/RD2ptgY8=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=Aa8jT9wNyLowGiBAYqbhMsZncW4BQel/ZsVMj+rtsxCalYLEn+9h3IzlomxOeIl6Q xWBkNEpPXf0bWbhmWWddEVEB1EmihB60lEkScFU0rwbXILzycJ41n2ALtQ89G8xd8A iw0ZCvQ2BPBT44W5w8P3tqws/cF1KgXd5QaVrEqJ3qIvEaJ7waEXRkjGMsglXbuuSA Oc+zFjuqgiS4M/YKm4aQ+pr3vgT/M1gEqChKMwkaYXXK1pawB31PcWb8MmUq2q9obK rPJN3HehJ3K4xYotwZewWOqxWM0/vHuBusxFgAP+ZAtmKvvrCI/DbGnZATHN28V3sU NLfj5iCOypX5A== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 6 Feb 2023 09:53:22 +0300 (MSK) From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "Michael S. Tsirkin" , Jason Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arseniy Krasnov , "Krasnov Arseniy" CC: "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "netdev@vger.kernel.org" , kernel Subject: [RFC PATCH v1 01/12] vsock: check error queue to set EPOLLERR Thread-Topic: [RFC PATCH v1 01/12] vsock: check error queue to set EPOLLERR Thread-Index: AQHZOfe0xY93Ok9p00a/1VHxin2e2Q== Date: Mon, 6 Feb 2023 06:53:22 +0000 Message-ID: <17a276d3-1112-3431-2a33-c17f3da67470@sberdevices.ru> In-Reply-To: <0e7c6fc4-b4a6-a27b-36e9-359597bba2b5@sberdevices.ru> 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: <0000EB679691B848B3AE40385576936D@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: 2023/02/06 01:18:00 #20834045 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-State: RFC If socket's error queue is not empty, EPOLLERR must be set. Signed-off-by: Arseniy Krasnov --- net/vmw_vsock/af_vsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 19aea7cba26e..b5e51ef4a74c 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1026,7 +1026,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock, poll_wait(file, sk_sleep(sk), wait); mask = 0; - if (sk->sk_err) + if (sk->sk_err || !skb_queue_empty_lockless(&sk->sk_error_queue)) /* Signify that there has been an error on this socket. */ mask |= EPOLLERR;