From patchwork Mon May 22 07:39:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arseniy Krasnov X-Patchwork-Id: 97167 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1275619vqo; Mon, 22 May 2023 00:53:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ590222tIIGRaHq+iMiRdyKgZgjm+92mzIHmZucDc7WZbSVeNqpc8PhcoOdlsQCzVgcvaZM X-Received: by 2002:a05:6a20:258c:b0:fa:1f3a:8f56 with SMTP id k12-20020a056a20258c00b000fa1f3a8f56mr11476055pzd.12.1684742033668; Mon, 22 May 2023 00:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684742033; cv=none; d=google.com; s=arc-20160816; b=gDTCTVMJ4xJVNgeYIYD5ezJ4HAfRlX7pFHcrgHGmw0vJv3PzOCJVTd6DmIL2dS9m3u oiKEh9YRyAYnHkblRQV8qmlyv6gGrmmqQlLNL0wYTgNwCxmXTWN8WfllahoxrwuYmd7J owGhdMlCO1rwECbvHDQELJx0pJJrGx/3bUhkEaQk+cSvdg/qvD2YWMIcJCVwC9nSkD3y MmVpqo2q687RJOZlsItfdhNd0JM2f8VydvaFrV5FEAbtKDp80AaxZHQf2e+NXayjxICQ Bi5xiNqcE4l4aE8cXM0GYlxQ6u4sahuhWp2Kav69Rp1QvxNcijz/ErJKb5JklSEM8rj/ t2og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T4VPQ+2KRx7PQirc2TEjhsgiTWul36vrSM2wuHKSIkQ=; b=iqySTXYmDFSyK8gL+JIivXUkgumZSC1Sucdo7ACZ9+XnemIh7L8RUW90qK9XsaMNIF vuWrvjpw2jWKvc/IaQU64uMa4LMjQjs5CA6tUimyXhcHBhUXpNjw6fkq6qyECyyAuuLL OJfILe3HgUY+BuSeNutsLH9yscdS8dXbGK0/3aT2Pfd7RfStb1zi8W1Q+xfP5cfGFSzg LLr9whYS5tzwVSbynC64knXwsVSSNor2DIHLFJ+xJEK2oU+H0VxKl4nX+8lwY8BrElXg zz/P34htUPnjgrfG3kfh9Mru2OqwjMlJ7ekDsi504iFvcJ1oHlFUeP9Kh6s8q70G/TFY cu2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=Y5eMpab3; 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 q21-20020a637515000000b0052c75ef69b6si82120pgc.231.2023.05.22.00.53.41; Mon, 22 May 2023 00:53:53 -0700 (PDT) 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=Y5eMpab3; 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 S232775AbjEVHpq (ORCPT + 99 others); Mon, 22 May 2023 03:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232660AbjEVHov (ORCPT ); Mon, 22 May 2023 03:44:51 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB36AC; Mon, 22 May 2023 00:44:50 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 667D25FD50; Mon, 22 May 2023 10:44:48 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1684741488; bh=T4VPQ+2KRx7PQirc2TEjhsgiTWul36vrSM2wuHKSIkQ=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Y5eMpab34LIf+imD9vM5eQ3D39MiMdTBnCv6InDRMbzU96z+7803HBJXHPWzeZhjM +HhqD9BrmMIwCd6SXPxb28CSeIhA+2mz8mXFaqBXEG6kjg+XAK3LW2dI38n77Ii/I4 vlbKtIHNY9CWYgxXKlIvjSjuYl/++HiUfDUZb/BuemR5TfkX9v147VzJf6Mwgl9bik Z/DSLve7imFxbCmb0ZKIcVNhwka60gzyjdO9u3eAk6/eiZm6WhJ9AW5tz91nl8Sq6C OPoLavAnhsU3eA7Wz5YNpagmpq7dSZVhRh0nPGp5tyKK4QBMToe16ix7Qp0JFbR3qP Xln0iqL7+Y3YA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 22 May 2023 10:44:48 +0300 (MSK) From: Arseniy Krasnov To: Stefan Hajnoczi , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S. Tsirkin" , Jason Wang , Bobby Eshleman CC: , , , , , , , Arseniy Krasnov Subject: [RFC PATCH v3 06/17] vsock: check error queue to set EPOLLERR Date: Mon, 22 May 2023 10:39:39 +0300 Message-ID: <20230522073950.3574171-7-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> References: <20230522073950.3574171-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) 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/05/22 04:49:00 #21364689 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_NONE, T_SCC_BODY_TEXT_LINE 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?1766580062809137141?= X-GMAIL-MSGID: =?utf-8?q?1766580062809137141?= If socket's error queue is not empty, EPOLLERR must be set. Otherwise, reader of error queue won't detect data in it using EPOLLERR bit. 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 413407bb646c..eea2bcc685a2 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1030,7 +1030,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;