Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3870076rwd; Sat, 3 Jun 2023 13:57:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ40+oMBSbpQkANhJJqOWrz6xPoy4slPoJgVitz0tvcQdIiJwJdRhGa+MZvCzhY/3rkc649A X-Received: by 2002:a05:6358:7206:b0:127:a46c:7cee with SMTP id h6-20020a056358720600b00127a46c7ceemr17688619rwa.8.1685825842926; Sat, 03 Jun 2023 13:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685825842; cv=none; d=google.com; s=arc-20160816; b=ebfsHYTcSVPqS0gjQGg7JbPl7GBx5mFU+NcefiHPS+Bw28ln+8O1eAsNQSotXwHUb5 CNC5ARzifMfGUdpLxzxSjyMD0wngCPQ80vQk1HlBPutCkhmKSkQigLDu1P39CWCWhOf2 rlnAEc0skl4s4twrZq2lcVMveluztVekwvNVHyKqiybvD1xqzaMZHe/vTsESoTKb5qpT hbDNA7wig9UZSIvSzlgXV8V3zSEhWe8j1echO01ZxUyrTnKASVX88pFNuo+5/FSyr0xI oMWwTWa7ejnpdZI9HrIbJicHIRI0jFE64GXJ44ccryxaA3SCEdXoHpLOO6yvfa3C/wz1 em4w== 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=Lz8wUwmvEr3RVG1tld+2qsVDKoN2L55XiM0gSmTilXk=; b=dLmIsQxQwq9AYOcEvK1sdxir2naFvFFDEgYFk+K8IrB7UY6Wkkb9i1/TrnH6YFhCnN 2BIKUKyGH1zrnd9BXvOpJNUtsKJWdgtTBlzsalnbTE2+OaYuPKBxl/UeobHlcJenKZxL oV7nuO6EbWh44zpqDOYTqAB/UNKutzXS+trH/KV/D0zK5HO8OsEcZMq8NXsUxR5m64TK kicqHOHOoLGQZrKrdjk02FslnIgLlRGTX4GxqlWXcBSDEiAxGm4t1HVf1fYZ0fAmR+R8 a988tjDpq/SAefRM23nj/1zbephzwKMmPe2WnH5Wf/WeO4ULHoXNoS4nXAco++RxkhBm svhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ZuNfwktT; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q16-20020a17090a2e1000b00258d8f6eabdsi3428373pjd.66.2023.06.03.13.57.10; Sat, 03 Jun 2023 13:57:22 -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=ZuNfwktT; 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 S232334AbjFCUzs (ORCPT + 99 others); Sat, 3 Jun 2023 16:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232390AbjFCUy7 (ORCPT ); Sat, 3 Jun 2023 16:54:59 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E8C19A; Sat, 3 Jun 2023 13:54:56 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id A12FD5FD36; Sat, 3 Jun 2023 23:54:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1685825687; bh=Lz8wUwmvEr3RVG1tld+2qsVDKoN2L55XiM0gSmTilXk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZuNfwktTwU0LX48iEAIFz2n10dgnL5mnVcLoEx1496yfGCwBz1AJhGKZdQ3XH38DZ ePCS0Cx5h6hMbQc4zlGJyMslh5wQ+aJa6DodmgQKMuvHJlE4HJf4ADGohtkr8cemeu wpr69g09J+z+ihNwbLBdVGkqmb6Ub+1CJbAAZK+f7hrz0kPxObuPSrANr91xyK67SN ZIKtExwgbdDnZGD+FLevtTsrzqIwFF0SOeQV5uVsF5ZcdxOgdMUC4CHcZHzkS9TFYl YLSg4SG2pntbamX9e2jBhnznNMihwoINiflyopoTmuj6IDrS9MVS68+1TOkTpyPepf 96sgS4sLs0XhQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Sat, 3 Jun 2023 23:54:47 +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 v4 06/17] vsock: check error queue to set EPOLLERR Date: Sat, 3 Jun 2023 23:49:28 +0300 Message-ID: <20230603204939.1598818-7-AVKrasnov@sberdevices.ru> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20230603204939.1598818-1-AVKrasnov@sberdevices.ru> References: <20230603204939.1598818-1-AVKrasnov@sberdevices.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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/06/03 16:55:00 #21417531 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,URIBL_BLOCKED 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 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 efb8a0937a13..45fd20c4ed50 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; -- 2.25.1