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: 53027 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2087587wrn; Sun, 5 Feb 2023 22:57:01 -0800 (PST) X-Google-Smtp-Source: AK7set/TAVXzr+dq1l1AB7jZDo+REqbfG7oArKjA5bWdtIGvGrKNpTCOdi395osoif85HToDathC X-Received: by 2002:a17:903:3012:b0:198:fa84:b392 with SMTP id o18-20020a170903301200b00198fa84b392mr4707540pla.46.1675666621489; Sun, 05 Feb 2023 22:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675666621; cv=none; d=google.com; s=arc-20160816; b=VvZWV5QaIIIy92G1FBTuCjgRMWIFe6z3UhjkdNQEGjMYHp4ZDb4f5c2aEFeC6EB+M0 /Rb5s+fYaFHOjQTGP6KMkXkMFyGdiz1ZaIBVto6LrTEHGANSX4zTtZL2BlqWUxLnXLYi RJ6igFxEteToKFxmgeP4rmgfzCEih1PewaHcfzIvVJv+FfQ1rKKsqsd5x4VS4O0B4SAh WhI8YdU5YRK3M92fAILMZs0eIUKmUYf6mT/WRsEIIYr/hyE9jLSW0j0AhKb7cjqGvjLm mpJ2QHIuG+n8gYqomhAwKRWblIgKZOwQaPUbMbTMY74YP/WodsDG9qJCCb8vpfy+zWqS uOYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=b+WXxyeJ81HGb6IFMi06G8yU3v92PAG7EK/RD2ptgY8=; b=Lodth3lxC/9tE66WdM6+Y8rLf6Y+T9qhP6JgFfNsujHeXadqdgvVFhJyecbETO88nI cX/KFXi3FuhSg0EcfY/7WMtLF+2lQ9r4n2G2gZylDUtZOp+CdApC2/xQOC4hZcMSdvCc +KGujjzavI+CfEMe6L9fQyp4FAWzchcZuxKpPvTDVAxRN9P9VEEA3LcoIoNl+IAwo33n APNqTUEYJDi5W94sF1S6lqZmVPJNdo5h+blg44Mr0YKwVNaMJXfPUxNIP0gjS+k7lzdc rV6WGfVOxfAjsw+w+sVsKs1PZdOq9FoFXSASBPsyUugS26fnLZUAZIvZIgoLXrVc1Huh Yztg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Aa8jT9wN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020a170902c1c900b00192d3110c58si9754963plc.18.2023.02.05.22.56.49; Sun, 05 Feb 2023 22:57:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Aa8jT9wN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229588AbjBFGxf (ORCPT + 99 others); Mon, 6 Feb 2023 01:53:35 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757063803303140466?= X-GMAIL-MSGID: =?utf-8?q?1757063803303140466?= 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(-) -- 2.25.1 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;